Open zpencerguy opened 7 years ago
Hi @zpencerguy .. What is your input
Using APPL when returned error.
def get_historical_stock_price(stock):
url = "http://real-chart.finance.yahoo.com/table.csv?s=%s&ignore=.csv" %(stock)
#print url
c = pd.read_csv(url)
return c
def main(): stock = 'AAPL' df_whole = get_historical_stock_price(stock)
KeyError Traceback (most recent call last) //anaconda/lib/python3.5/site-packages/pandas/core/indexing.py in _has_valid_type(self, key, axis) 1394 if key not in ax: -> 1395 error() 1396 except TypeError as e:
//anaconda/lib/python3.5/site-packages/pandas/core/indexing.py in error() 1389 raise KeyError("the label [%s] is not in the [%s]" % -> 1390 (key, self.obj._get_axis_name(axis))) 1391
KeyError: 'the label [Sunday] is not in the [index]'
During handling of the above exception, another exception occurred:
KeyError Traceback (most recent call last)