Open veonua opened 5 years ago
It's a little hard to help you diagnose your issue without your code. Could you please give us a reproducible example?
just open https://github.com/quantopian/empyrical/blob/master/empyrical/utils.py#L436
and remove lines 436 and 437
Please see https://github.com/quantopian/empyrical#deprecated-data-reading-via-pandas-datareader
Since https://github.com/quantopian/empyrical/pull/97 we have deprecated all data-reading functionality from empyrical
.
and remove lines 436 and 437
and change:
rets = px[['adjclose']].pct_change().dropna()
to
rets = px[['Adj Close']].pct_change().dropna()
I made a PR, let's see if Quantutopian will merge it...
KeyError: 'date'
During handling of the above exception, another exception occurred:
KeyError Traceback (most recent call last) /usr/local/lib/python3.6/dist-packages/empyrical/utils.py in get_symbol_returns_from_yahoo(symbol, start, end) 435 px = web.get_data_yahoo(symbol, start=start, end=end) --> 436 px['date'] = pd.to_datetime(px['date']) 437 px.set_index('date', drop=False, inplace=True)
Date is index field Index(['High', 'Low', 'Open', 'Close', 'Volume', 'Adj Close'], dtype='object')