Pandas Datareader


In [ ]:
import pandas_datareader.data as web
import datetime

In [2]:
start = datetime.datetime(2015, 1, 1)
end = datetime.datetime(2017, 1, 1)

In [4]:
facebook = web.DataReader("FB", "google", start, end)

In [5]:
facebook.head()


Out[5]:
Open High Low Close Volume
Date
2016-10-17 128.20 128.47 127.32 127.54 11351681
2016-10-18 128.68 129.39 128.01 128.57 13503967
2016-10-19 128.74 130.47 128.60 130.11 16752321
2016-10-20 130.07 130.66 129.50 130.00 13167503
2016-10-21 129.78 132.13 129.70 132.07 19088794

In [6]:
from pandas_datareader.data import Options

In [7]:
fb_options = Options("FB", "google")

In [9]:
options_df = fb_options.get_options_data(expiry=fb_options.expiry_dates[0])

In [11]:
options_df.head()


Out[11]:
Last Bid Ask Chg PctChg Vol Open_Int Root Underlying_Price Quote_Time
Strike Expiry Type Symbol
5.0 2018-01-19 call FB180119C00005000 164.50 168.5 169.05 0.0 0.0 NaN 9359.0 FB 173.74001 2017-10-14 15:14:00.065276
put FB180119P00005000 0.01 NaN 0.03 0.0 0.0 NaN 3053.0 FB 173.74001 2017-10-14 15:14:00.065276
10.0 2018-01-19 call FB180119C00010000 157.85 163.6 164.15 0.0 0.0 NaN 2691.0 FB 173.74001 2017-10-14 15:14:00.065276
put FB180119P00010000 0.01 NaN 0.01 0.0 0.0 NaN 2056.0 FB 173.74001 2017-10-14 15:14:00.065276
15.0 2018-01-19 call FB180119C00015000 158.70 158.6 159.15 0.0 0.0 NaN 250.0 FB 173.74001 2017-10-14 15:14:00.065276

Quandl


In [21]:
import quandl
import matplotlib.pyplot as plt
%matplotlib inline

In [22]:
mydata = quandl.get("EIA/PET_RWTC_D")

In [23]:
mydata.plot()
plt.show()



In [26]:
mydata = quandl.get("WIKI/AAPL.1")

In [27]:
mydata.head()


Out[27]:
Open
Date
1980-12-12 28.75
1980-12-15 27.38
1980-12-16 25.37
1980-12-17 25.87
1980-12-18 26.63