EventVestor: Earnings Guidance

In this notebook, we'll take a look at EventVestor's Earnings Guidance dataset, available on the Quantopian Store. This dataset spans January 01, 2007 through the current day, and documents forward looking earnings guidance provided by companies.

Blaze

Before we dig into the data, we want to tell you about how you generally access Quantopian Store data sets. These datasets are available through an API service known as Blaze. Blaze provides the Quantopian user with a convenient interface to access very large datasets.

Blaze provides an important function for accessing these datasets. Some of these sets are many millions of records. Bringing that data directly into Quantopian Research directly just is not viable. So Blaze allows us to provide a simple querying interface and shift the burden over to the server side.

It is common to use Blaze to reduce your dataset in size, convert it over to Pandas and then to use Pandas for further computation, manipulation and visualization.

Helpful links:

Once you've limited the size of your Blaze object, you can convert it to a Pandas DataFrames using:

from odo import odo
odo(expr, pandas.DataFrame)

Free samples and limits

One other key caveat: we limit the number of results returned from any given expression to 10,000 to protect against runaway memory usage. To be clear, you have access to all the data server side. We are limiting the size of the responses back from Blaze.

There is a free version of this dataset as well as a paid one. The free one includes about three years of historical data, though not up to the current day.

With preamble in place, let's get started:


In [9]:
# import the dataset
from quantopian.interactive.data.eventvestor import earnings_guidance
# or if you want to import the free dataset, use:
# from quantopian.interactive.data.eventvestor import earnings_guidance_free

# import data operations
from odo import odo
# import other libraries we will use
import pandas as pd

In [10]:
# Let's use blaze to understand the data a bit using Blaze dshape()
earnings_guidance.dshape


Out[10]:
dshape("""var * {
  event_id: ?float64,
  asof_date: datetime,
  trade_date: ?datetime,
  symbol: ?string,
  event_type: ?string,
  event_headline: ?string,
  event_phase: ?string,
  guidance_content: ?string,
  guidance_gaap: ?string,
  guidance_trend: ?string,
  guidance_quality: ?string,
  fiscal_quarter: ?string,
  eps_low: ?float64,
  eps_high: ?float64,
  revenue_low: ?float64,
  revenue_high: ?float64,
  netincome_low: ?float64,
  netincome_high: ?float64,
  fiscal_year: ?string,
  annual_trend: ?string,
  event_rating: ?float64,
  timestamp: datetime,
  sid: ?int64
  }""")

In [11]:
# And how many rows are there?
# N.B. we're using a Blaze function to do this, not len()
earnings_guidance.count()


Out[11]:
97769

In [12]:
# Let's see what the data looks like. We'll grab the first three rows.
earnings_guidance[:3]


Out[12]:
event_id asof_date trade_date symbol event_type event_headline event_phase guidance_content guidance_gaap guidance_trend guidance_quality fiscal_quarter eps_low eps_high revenue_low revenue_high netincome_low netincome_high fiscal_year annual_trend event_rating timestamp sid
0 933903 2007-01-02 2007-01-02 INOD Guidance Numerex Raises 4Q and FY 06 Guidance NaN Other Financial GAAP Higher Open Ended 4Q 06 0.00 0.00 0 0 0 0 FY 06 Higher 1 2007-01-03 9581
1 138379 2007-01-02 2007-01-03 SLG Guidance SL Green Realty Issues FY 07 FFO Guidance NaN Other Financial Non-GAAP NaN NaN NaN 0.00 0.00 0 0 0 0 FY 07 New 1 2007-01-03 17448
2 137809 2007-01-03 2007-01-03 AEO Guidance American Eagle Raises 4Q 06 EPS Guidance NaN EPS GAAP Higher Range 4Q 06 0.64 0.65 0 0 0 0 NaN NaN 1 2007-01-04 11086

Let's go over the columns:

  • event_id: the unique identifier for this event.
  • asof_date: EventVestor's timestamp of event capture.
  • trade_date: for event announcements made before trading ends, trade_date is the same as event_date. For announcements issued after market close, trade_date is next market open day.
  • symbol: stock ticker symbol of the affected company.
  • event_type: this should always be Guidance.
  • event_headline: a brief description of the event
  • event_phase: the inclusion of this field is likely an error on the part of the data vendor. We're currently attempting to resolve this.
  • guidance_content: values include EPS, EPS & Financial, Operational, Other Financial
  • guidance_gaap: values include GAAP, Non-GAAP
  • guidance_trend: values include Higher, Lower, Narrows, New, Reiterate, Withdrawal
  • guidance_quality: values include Open Ended, Point, Range
  • fiscal_quarter: fiscal quarter for which guidance is provided
  • eps_low: low end of the quarterly EPS guidance
  • eps_high: high end of the quarterly EPS guidance
  • revenue_low: low end of the quarterly revenue guidance
  • revenue_high: high end of the quarterly revenue guidance
  • netincome_low: low end of the quarterly net income guidance
  • netincome_high: high end of the quarterly net income guidance
  • fiscal_year: fiscal year for which the quarterly guidance is provided
  • annual_trend: the annual guidance trend. Values include Higher, Lower, Narrows, New, Reiterate, Withdrawal
  • event_rating: this is always 1. The meaning of this is uncertain.
  • timestamp: this is our timestamp on when we registered the data.
  • sid: the equity's unique identifier. Use this instead of the symbol.

We've done much of the data processing for you. Fields like timestamp and sid are standardized across all our Store Datasets, so the datasets are easy to combine. We have standardized the sid across all our equity databases.

We can select columns and rows with ease. Below, we'll fetch all of Apple's entries from 2012.


In [13]:
# get apple's sid first
aapl_sid = symbols('AAPL').sid
aapl_earnings = earnings_guidance[('2011-12-31' < earnings_guidance['asof_date']) & (earnings_guidance['asof_date'] <'2013-01-01') & (earnings_guidance.sid==aapl_sid)]
# When displaying a Blaze Data Object, the printout is automatically truncated to ten rows.
aapl_earnings.sort('asof_date')


Out[13]:
event_id asof_date trade_date symbol event_type event_headline event_phase guidance_content guidance_gaap guidance_trend guidance_quality fiscal_quarter eps_low eps_high revenue_low revenue_high netincome_low netincome_high fiscal_year annual_trend event_rating timestamp sid
0 1385926 2012-01-24 2012-01-25 AAPL Guidance Apple Issues 2Q 12 Guidance NaN EPS & Financial GAAP New Point 2Q 12 8.50 8.50 3250 3250 0 0 NaN NaN 1 2012-01-25 24
1 1421102 2012-04-24 2012-04-25 AAPL Guidance Apple Issues 3Q 12 Guidance NaN EPS & Financial GAAP New Point 3Q 12 8.68 8.68 34000 34000 0 0 NaN NaN 1 2012-04-25 24
2 1456501 2012-07-24 2012-07-25 AAPL Guidance Apple Issues 4Q 12 Guidance NaN EPS & Financial GAAP New Point 4Q 12 7.65 7.65 34000 34000 0 0 NaN NaN 1 2012-07-25 24
3 1496798 2012-10-25 2012-10-26 AAPL Guidance Apple Issues 1Q 13 Guidance NaN EPS & Financial GAAP New Point 1Q 13 11.75 11.75 5200 5200 0 0 NaN NaN 1 2012-10-26 24

Finally, suppose we want a DataFrame of all earnings guidances releases in 2012 in which revenue_low and revenue_high differ. Then we'll compute by how much they differ!


In [14]:
# manipulate with Blaze first:
twentytwelve = earnings_guidance[(earnings_guidance['asof_date'] < '2012-12-31')&('2012-01-01' <= earnings_guidance['asof_date'])]
# now that we've got a much smaller object (len: ~39000 rows), we can convert it to a pandas DataFrame
df = odo(twentytwelve, pd.DataFrame)
df = df[df.revenue_low != df.revenue_high]
df['revenue_difference'] = df.revenue_high - df.revenue_low
df.sort('revenue_difference', ascending=False, inplace=True)
df.index = range(len(df))
# When printed: pandas DataFrames display the head(30) and tail(30) rows, and truncate the middle.
df


Out[14]:
event_id asof_date trade_date symbol event_type event_headline event_phase guidance_content guidance_gaap guidance_trend ... revenue_low revenue_high netincome_low netincome_high fiscal_year annual_trend event_rating timestamp sid revenue_difference
0 1930090 2012-07-26 2012-07-26 ATE Guidance Advantest Corp. Issues 2Q 12 & Narrows FY 12 O... NaN Other Financial GAAP New ... 72000.00 77000.00 0.0 0.0 FY 12 Narrows 1 2012-07-27 23052 5000.00
1 1496843 2012-10-25 2012-10-26 AMZN Guidance Amazon.com Issues 4Q 12 Guidance NaN Other Financial GAAP New ... 20250.00 22750.00 0.0 0.0 NaN NaN 1 2012-10-26 16841 2500.00
2 1496029 2012-10-25 2012-10-25 TSM Guidance Taiwan Semiconductor Issues 4Q 12 Guidance NaN Other Financial GAAP New ... 129000.00 131000.00 0.0 0.0 NaN NaN 1 2012-10-26 17773 2000.00
3 1490534 2012-09-10 2012-09-10 TSM Guidance Taiwan Semiconductor Raises 3Q 12 Guidance NaN Other Financial GAAP Higher ... 136000.00 138000.00 0.0 0.0 NaN NaN 1 2012-09-11 17773 2000.00
4 1454839 2012-07-19 2012-07-19 TSM Guidance Taiwan Semiconductor Issues 3Q 12 Guidance NaN Other Financial GAAP New ... 136000.00 138000.00 0.0 0.0 NaN NaN 1 2012-07-20 17773 2000.00
5 1384154 2012-01-18 2012-01-18 TSM Guidance Taiwan Semiconductor Issues 1Q & FY 12 Guidance NaN Other Financial GAAP New ... 103000.00 105000.00 0.0 0.0 FY 12 New 1 2012-01-19 17773 2000.00
6 1423149 2012-04-26 2012-04-26 TSM Guidance Taiwan Semiconductor Issues 2Q & Revises FY 12... NaN Operational NaN New ... 126000.00 128000.00 0.0 0.0 FY 12 NaN 1 2012-04-27 17773 2000.00
7 1419797 2012-04-20 2012-04-20 INTU Guidance Intuit Reaffirms 3Q & FY 12 Earnings Guidance NaN EPS & Financial GAAP Reiterate ... 0.00 1950.00 0.0 0.0 FY 12 Reiterate 1 2012-04-21 8655 1950.00
8 1388974 2012-01-31 2012-02-01 AMZN Guidance Amazon Issues 1Q 12 Guidance NaN Other Financial GAAP New ... 12000.00 13400.00 0.0 0.0 NaN NaN 1 2012-02-01 16841 1400.00
9 1422959 2012-04-26 2012-04-27 AMZN Guidance Amazon.com Issues 2Q 12 Guidance NaN Other Financial GAAP New ... 11900.00 13300.00 0.0 0.0 NaN NaN 1 2012-04-27 16841 1400.00
10 1491411 2012-10-16 2012-10-17 INTC Guidance Intel Corp. Issues 4Q and Revises FY 12 Guidance NaN Other Financial Non-GAAP New ... 13100.00 14100.00 0.0 0.0 FY 12 NaN 1 2012-10-17 3951 1000.00
11 1453377 2012-07-17 2012-07-18 INTC Guidance Intel Corp. Issues 3Q and Lowers FY 12 Revenue... NaN Other Financial GAAP New ... 13800.00 14800.00 0.0 0.0 FY 12 Lower 1 2012-07-18 3951 1000.00
12 1384551 2012-01-19 2012-01-20 INTC Guidance Intel Issues 1Q & FY 12 Outlook NaN Other Financial GAAP New ... 12300.00 13300.00 0.0 0.0 FY 12 New 1 2012-01-20 3951 1000.00
13 1418488 2012-04-17 2012-04-18 INTC Guidance Intel Issues 2Q and Revises FY 12 Outlook NaN Other Financial GAAP New ... 13100.00 14100.00 0.0 0.0 FY 12 NaN 1 2012-04-18 3951 1000.00
14 1495917 2012-10-25 2012-10-25 AVT Guidance Avnet Issues 2Q 13 Guidance NaN EPS & Financial Non-GAAP New ... 5950.00 6650.00 0.0 0.0 NaN NaN 1 2012-10-26 661 700.00
15 1387009 2012-01-26 2012-01-26 AVT Guidance Avnet Issues 3Q 12 Guidance NaN EPS & Financial Non-GAAP New ... 5950.00 6550.00 0.0 0.0 NaN NaN 1 2012-01-27 661 600.00
16 1467054 2012-08-08 2012-08-08 AVT Guidance Avnet Issues 1Q 13 Guidance NaN EPS & Financial Non-GAAP New ... 5800.00 6400.00 0.0 0.0 NaN NaN 1 2012-08-09 661 600.00
17 1422463 2012-04-26 2012-04-26 AVT Guidance Avnet Issues 4Q 12 Guidance NaN EPS & Financial Non-GAAP New ... 6300.00 6900.00 0.0 0.0 NaN NaN 1 2012-04-27 661 600.00
18 1459661 2012-07-30 2012-07-30 ARW Guidance Arrow Electronics Issues 3Q 12 Guidance NaN EPS & Financial Non-GAAP New ... 4800.00 5200.00 0.0 0.0 3Q 12 NaN 1 2012-07-31 538 400.00
19 1492709 2012-10-18 2012-10-19 FLEX Guidance Flextronics International Issues 3Q 13 Guidance NaN EPS & Financial GAAP New ... 5800.00 6200.00 0.0 0.0 NaN NaN 1 2012-10-19 10953 400.00
20 1389393 2012-02-01 2012-02-01 ARW Guidance Arrow Electronics Issues 1Q 12 Guidance NaN EPS & Financial Non-GAAP New ... 4670.00 5070.00 0.0 0.0 NaN NaN 1 2012-02-02 538 400.00
21 1424909 2012-05-01 2012-05-01 ARW Guidance Arrow Electronics Issues 2Q 12 Guidance NaN EPS & Financial Non-GAAP New ... 5040.00 5440.00 0.0 0.0 NaN NaN 1 2012-05-02 538 400.00
22 1418864 2012-04-18 2012-04-19 QCOM Guidance Qualcomm Issues 3Q & Raises FY 12 Guidance NaN EPS & Financial GAAP New ... 4450.00 4850.00 0.0 0.0 FY 12 Higher 1 2012-04-19 6295 400.00
23 1454039 2012-07-18 2012-07-19 QCOM Guidance Qualcomm Issues 4Q and Lowers FY 12 Guidance NaN EPS & Financial GAAP New ... 4450.00 4850.00 0.0 0.0 FY 12 Lower 1 2012-07-19 6295 400.00
24 1457395 2012-07-25 2012-07-26 FLEX Guidance Flextronics International Issues 2Q 13 Guidance NaN EPS & Financial GAAP New ... 5900.00 6300.00 0.0 0.0 NaN NaN 1 2012-07-26 10953 400.00
25 1425487 2012-05-01 2012-05-02 FLEX Guidance Flextronics International Issues 1Q 13 Guidance NaN EPS & Financial GAAP New ... 5900.00 6300.00 0.0 0.0 NaN NaN 1 2012-05-02 10953 400.00
26 1389626 2012-02-01 2012-02-02 QCOM Guidance Qualcomm Issues 2Q and Raises FY 12 Guidance NaN EPS & Financial GAAP New ... 4600.00 5000.00 0.0 0.0 FY 12 Higher 1 2012-02-02 6295 400.00
27 1380315 2012-01-04 2012-01-05 STX Guidance Seagate Technology Raises 3Q 12 Outlook NaN Other Financial Non-GAAP Higher ... 4200.00 4500.00 0.0 0.0 NaN NaN 1 2012-01-05 24518 300.00
28 1384635 2012-01-19 2012-01-20 FLEX Guidance Flextronics Issues 4Q 12 Guidance NaN EPS & Financial GAAP New ... 6300.00 6600.00 0.0 0.0 NaN NaN 1 2012-01-20 10953 300.00
29 1419632 2012-04-19 2012-04-19 CVI Guidance CVR Energy Issues 1Q 12 Guidance NaN Other Financial GAAP New ... 1800.00 2100.00 0.0 0.0 NaN NaN 1 2012-04-20 22766 300.00
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
1599 1398611 2012-02-21 2012-02-22 ZIXI Guidance Zix Corp. Issues 1Q and FY 12 Guidance NaN EPS & Financial Non-GAAP New ... 10.00 10.10 0.0 0.0 FY 12 New 1 2012-02-22 20822 0.10
1600 1403341 2012-02-29 2012-03-01 MTZ Guidance MasTec Issues 1Q and FY 12 Outlook NaN EPS & Financial GAAP New ... 0.15 0.17 12.3 14.1 FY 12 New 1 2012-03-01 4667 0.02
1601 1387298 2012-01-26 2012-01-27 CYS Guidance CYS Investments Issues 4Q 11 Guidance NaN EPS GAAP New ... 0.55 0.00 0.0 0.0 NaN NaN 1 2012-01-27 38477 -0.55
1602 1439505 2012-02-14 2012-02-14 KORS Guidance Michael Kors Holdings Issues 4Q & FY 12 Guidance NaN EPS & Financial GAAP New ... 350.00 335.00 0.0 0.0 FY 12 New 1 2012-02-15 42270 -15.00
1603 1424617 2012-04-26 2012-04-26 INOD Guidance Innodata Isogen Issues 2Q 12 Revenue Guidance NaN Other Financial GAAP New ... 21.00 0.00 0.0 0.0 NaN NaN 1 2012-04-27 9581 -21.00
1604 1382294 2012-01-11 2012-01-11 SAAS Guidance inContact Issues 4Q 11 Guidance NaN Other Financial GAAP New ... 23.50 0.00 0.0 0.0 NaN NaN 1 2012-01-12 31137 -23.50
1605 1441324 2012-06-06 2012-06-06 AMSC Guidance American Superconductor Issues 1Q 12 Guidance NaN EPS & Financial GAAP New ... 26.00 0.00 0.0 10.0 NaN NaN 1 2012-06-07 393 -26.00
1606 1393252 2012-02-09 2012-02-09 AMSC Guidance American Superconductor Updates 4Q 11 Outlook NaN EPS & Financial GAAP NaN ... 27.00 0.00 -24.0 0.0 NaN NaN 1 2012-02-10 393 -27.00
1607 1391621 2012-02-06 2012-02-07 BDE Guidance Black Diamond Issues 4Q and Raises FY 11 Guidance NaN EPS & Financial GAAP New ... 36.00 0.00 0.0 0.0 FY 11 Higher 1 2012-02-07 18803 -36.00
1608 1544306 2012-06-04 2012-06-04 CALL Guidance magicJack VocalTec Issues 2Q and Raises FY 12 ... NaN EPS & Financial GAAP New ... 36.00 0.00 0.0 0.0 FY 12 Higher 1 2012-06-05 14457 -36.00
1609 1411122 2012-03-20 2012-03-21 FSII Guidance FSI International Issues 3Q 12 Guidance NaN Other Financial GAAP New ... 50.00 0.00 7.0 9.0 NaN NaN 1 2012-03-21 3029 -50.00
1610 1412014 2012-03-23 2012-03-23 KITD Guidance KIT digital Reaffirms 1Q and FY 12 Guidance NaN EPS & Financial Non-GAAP Reiterate ... 72.00 0.00 0.0 0.0 FY 12 Reiterate 1 2012-03-24 30692 -72.00
1611 1401903 2012-02-27 2012-02-28 KITD Guidance KIT digital Issues 1Q and Lowers FY 12 Guidance NaN EPS & Financial Non-GAAP New ... 72.00 0.00 0.0 0.0 FY 12 Lower 1 2012-02-28 30692 -72.00
1612 1409726 2012-03-15 2012-03-15 KITD Guidance KIT digital Reaffirms 1Q and FY 12 Guidance NaN EPS & Financial Non-GAAP Reiterate ... 72.00 0.00 0.0 0.0 FY 12 Reiterate 1 2012-03-16 30692 -72.00
1613 1490036 2012-10-11 2012-10-12 ET Guidance ExactTarget Raises 3Q 12 Guidance NaN Other Financial Non-GAAP Higher ... 72.00 0.00 -3.0 0.0 NaN NaN 1 2012-10-12 42700 -72.00
1614 1391196 2012-02-02 2012-02-02 FTK Guidance Flotek Industries Issues 4Q and FY 11 Guidance NaN Other Financial GAAP New ... 74.50 0.00 0.0 0.0 FY 11 New 1 2012-02-03 27496 -74.50
1615 1417909 2012-04-16 2012-04-16 FTK Guidance Flotek Industries Raises 1Q 12 Revenues Guidance NaN Other Financial GAAP New ... 78.00 0.00 0.0 0.0 NaN NaN 1 2012-04-17 27496 -78.00
1616 1437795 2012-01-24 2012-01-24 FIO Guidance Fusion-io Issues 3Q & Raises FY 12 Guidance NaN Other Financial Non-GAAP New ... 85.00 0.00 0.0 0.0 FY 12 Higher 1 2012-01-25 41554 -85.00
1617 1443898 2012-05-14 2012-05-14 MPAA Guidance Motorcar Parts of America Issues 4Q and FY 12 ... NaN Other Financial GAAP New ... 90.00 0.00 0.0 0.0 FY 12 New 1 2012-05-15 10992 -90.00
1618 1400239 2012-02-23 2012-02-24 WBMD Guidance WebMD Health Issues 1Q and Updates FY 12 Guidance NaN Other Financial Non-GAAP New ... 105.00 0.00 0.0 0.0 FY 12 NaN 1 2012-02-24 27669 -105.00
1619 1457505 2012-07-25 2012-07-26 CVD Guidance Covance Issues 3Q and Lowers FY 12 Guidance NaN EPS & Financial Non-GAAP New ... 538.00 0.00 0.0 0.0 FY 12 Lower 1 2012-07-26 25396 -538.00
1620 1486588 2012-01-06 2012-01-06 VRX Guidance Valeant Pharmaceuticals Issues 4Q and Updates ... NaN EPS & Financial Non-GAAP New ... 650.00 0.00 0.0 0.0 FY 11 NaN 1 2012-01-07 10908 -650.00
1621 1416853 2012-04-11 2012-04-11 VMW Guidance VMware Raises 1Q 12 Guidance NaN Other Financial GAAP Higher ... 1040.00 0.00 0.0 0.0 NaN NaN 1 2012-04-12 34545 -1040.00
1622 1392473 2012-02-08 2012-02-08 CTSH Guidance Cognizant Technology Solutions Issues 1Q and F... NaN EPS & Financial GAAP New ... 1700.00 0.00 0.0 0.0 FY 12 New 1 2012-02-09 18870 -1700.00
1623 1428889 2012-05-07 2012-05-07 CTSH Guidance Cognizant Technology Solutions Issues 2Q and L... NaN EPS & Financial GAAP New ... 1790.00 0.00 0.0 0.0 FY 12 Lower 1 2012-05-08 18870 -1790.00
1624 1464692 2012-08-06 2012-08-06 CTSH Guidance Cognizant Technology Solutions Issues 3Q and R... NaN EPS & Financial GAAP New ... 1875.00 0.00 0.0 0.0 FY 12 Higher 1 2012-08-07 18870 -1875.00
1625 1388993 2012-01-31 2012-02-01 STX Guidance Seagate Technology Raises 3Q 12 Outlook NaN Other Financial GAAP Higher ... 4300.00 0.00 0.0 0.0 NaN NaN 1 2012-02-01 24518 -4300.00
1626 1422045 2012-04-26 2012-04-26 TYC Guidance Tyco International Issues 3Q and Raises FY 12 ... NaN EPS & Financial Non-GAAP New ... 4500.00 0.00 0.0 0.0 FY 12 Higher 1 2012-04-27 7679 -4500.00
1627 1433072 2012-04-17 2012-04-17 STX Guidance Seagate Technology Updates 4Q 12 and Calendar ... NaN Other Financial Non-GAAP NaN ... 5000.00 0.00 0.0 0.0 NaN NaN 1 2012-04-18 24518 -5000.00
1628 1389165 2012-01-31 2012-02-01 STX Guidance Seagate Technology Issues 4Q 12 Outlook NaN Other Financial GAAP New ... 5000.00 0.00 0.0 0.0 NaN NaN 1 2012-02-01 24518 -5000.00

1629 rows × 24 columns


In [ ]: