Fixing the 'BV' key being missing for USDT

This commit is contained in:
Jean-Baptiste LE STANG
2018-01-20 15:03:12 +01:00
parent f6df701b84
commit 960d088deb
2 changed files with 2 additions and 4 deletions

View File

@@ -30,8 +30,9 @@ def parse_ticker_dataframe(ticker: list) -> DataFrame:
"""
columns = {'C': 'close', 'V': 'volume', 'O': 'open', 'H': 'high', 'L': 'low', 'T': 'date'}
frame = DataFrame(ticker) \
.drop('BV', 1) \
.rename(columns=columns)
if 'BV' in frame:
frame.drop('BV', 1, inplace=True)
frame['date'] = to_datetime(frame['date'], utc=True, infer_datetime_format=True)
frame.sort_values('date', inplace=True)
return frame