This is a code I am trying
import matplotlib.pyplot as plt
import pandas as pd
ticker = \'GLD\'
begdate = \'2014-11-11\'
enddate = \'2016-11-11\'
data1 =
pandas has removed that functionality and it is now offered as a different package (link):
DataReader The sub-package pandas.io.data is removed in favor of a separately installable pandas-datareader package. This will allow the data modules to be independently updated to your pandas installation. The API for pandas-datareader v0.1.1 is the same as in pandas v0.16.1. (GH8961)
You should replace the imports of the following:
from pandas.io import data, wbWith the following:
from pandas_datareader import data, wb
Install pandas_datareader with pip install pandas-datareader
and replace the code with the following:
from pandas_datareader import data
import datetime as dt
ticker = 'GLD'
begdate = '2014-11-11'
enddate = '2016-11-11'
data1 = data.DataReader(ticker,'yahoo',dt.datetime(2014,11,11),dt.datetime(2016,11,11))