import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline

import pandas_datareader.data as web
import datetime
start = datetime.datetime(2020, 1, 1)
end = pd.to_datetime('today')
AAPL_stock = web.DataReader('AAPL', 'yahoo', start, end)
AAPL_stock.head()

MSFT_stock = web.DataReader('MSFT', 'yahoo', start, end)
MSFT_stock.head()

ZOOM_stock = web.DataReader('ZM', 'yahoo', start, end)
ZOOM_stock.head()

SNOW_stock = web.DataReader('SNOW', 'yahoo', start, end)
SNOW_stock.head()
High Low Open Close Volume Adj Close
Date
2020-09-16 319.0 231.110001 245.000000 253.929993 36099700 253.929993
2020-09-17 241.5 215.240005 230.759995 227.539993 11907500 227.539993
2020-09-18 249.0 218.589996 235.000000 240.000000 7475400 240.000000
2020-09-21 241.5 218.600006 230.000000 228.850006 5524900 228.850006
2020-09-22 239.0 225.149994 238.500000 235.160004 3889100 235.160004
fig = plt.figure(figsize=(12, 6))
plt.title('Open')

MSFT_stock['Open'].plot(label='Microsoft')
ZOOM_stock['Open'].plot(label='Zoom')
SNOW_stock['Open'].plot(label='Snowflake')
AAPL_stock['Open'].plot(label='Apple')
plt.legend()

fig = plt.figure(figsize=(12, 6))
plt.title('Volume')

MSFT_stock['Volume'].plot(label='Microsoft')
ZOOM_stock['Volume'].plot(label='Zoom')
SNOW_stock['Volume'].plot(label='Snowflake')
AAPL_stock['Volume'].plot(label='Apple')

plt.legend()
<matplotlib.legend.Legend at 0x7f3e5dc577f0>
import pandas_datareader.data as web

import datetime



gdp = web.DataReader("GDP", "fred", start, end)
gdp.head()
GDP
DATE
2020-01-01 21561.139
2020-04-01 19520.114
2020-07-01 21170.252
import quandl
#quandl.ApiConfig.api_key = ''
mydata = quandl.get("EIA/PET_RWTC_D")

mydata.head()
---------------------------------------------------------------------------
LimitExceededError                        Traceback (most recent call last)
<ipython-input-10-68997e6ce84c> in <module>
----> 1 mydata = quandl.get("EIA/PET_RWTC_D")
      2 
      3 mydata.head()

~/anaconda3/lib/python3.8/site-packages/quandl/get.py in get(dataset, **kwargs)
     46         if dataset_args['column_index'] is not None:
     47             kwargs.update({'column_index': dataset_args['column_index']})
---> 48         data = Dataset(dataset_args['code']).data(params=kwargs, handle_column_not_found=True)
     49     # Array
     50     elif isinstance(dataset, list):

~/anaconda3/lib/python3.8/site-packages/quandl/model/dataset.py in data(self, **options)
     45         updated_options = Util.merge_options('params', params, **options)
     46         try:
---> 47             return Data.all(**updated_options)
     48         except NotFoundError:
     49             if handle_not_found_error:

~/anaconda3/lib/python3.8/site-packages/quandl/operations/list.py in all(cls, **options)
     13             options['params'] = {}
     14         path = Util.constructed_path(cls.list_path(), options['params'])
---> 15         r = Connection.request('get', path, **options)
     16         response_data = r.json()
     17         Util.convert_to_dates(response_data)

~/anaconda3/lib/python3.8/site-packages/quandl/connection.py in request(cls, http_verb, url, **options)
     36         abs_url = '%s/%s' % (ApiConfig.api_base, url)
     37 
---> 38         return cls.execute_request(http_verb, abs_url, **options)
     39 
     40     @classmethod

~/anaconda3/lib/python3.8/site-packages/quandl/connection.py in execute_request(cls, http_verb, url, **options)
     48                                        **options)
     49             if response.status_code < 200 or response.status_code >= 300:
---> 50                 cls.handle_api_error(response)
     51             else:
     52                 return response

~/anaconda3/lib/python3.8/site-packages/quandl/connection.py in handle_api_error(cls, resp)
    112         klass = d_klass.get(code_letter, QuandlError)
    113 
--> 114         raise klass(message, resp.status_code, resp.text, resp.headers, code)

LimitExceededError: (Status 429) (Quandl Error QELx01) You have exceeded the anonymous user limit of 50 calls per day. To make more calls today, please register for a free Quandl account and then include your API key with your requests.
mydata.plot(figsize=(12,6))
#mydata = quandl.get("EIA/PET_RWTC_D", returns="numpy",start_date=start,end_date=end)
mydata = quandl.get("FRED/GDP",start_date=start,end_date=end)
mydata.head()
mydata = quandl.get(["NSE/OIL.1", "WIKI/AAPL.4"],start_date=start,end_date=end)
mydata.head()
NSE/OIL - Open WIKI/AAPL - Close
mydata = quandl.get("FRED/GDP")
mydata = quandl.get('WIKI/FB',start_date=start,end_date=end)
mydata.head()
Open High Low Close Volume Ex-Dividend Split Ratio Adj. Open Adj. High Adj. Low Adj. Close Adj. Volume
Date
mydata = quandl.get('WIKI/FB.1',start_date=start,end_date=end)

mydata.head()
Open
Date
mydata = quandl.get('WIKI/FB.7',start_date=start,end_date=end)
mydata.head()
Split Ratio
Date
# Homes
houses = quandl.get('ZILLOW/M11_ZRIAH',start_date=start,end_date=end)
houses.head()
Value
Date
2020-01-31 3342.0
2020-02-29 3358.0
houses.plot()
<matplotlib.axes._subplots.AxesSubplot at 0x7f900d58fef0>