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

View File

@ -196,7 +196,6 @@ def ticker_history():
"C": 8.88e-05,
"V": 991.09056638,
"T": "2017-11-26T08:50:00",
"BV": 0.0877869
},
{
"O": 8.88e-05,
@ -205,7 +204,6 @@ def ticker_history():
"C": 8.893e-05,
"V": 658.77935965,
"T": "2017-11-26T08:55:00",
"BV": 0.05874751
},
{
"O": 8.891e-05,
@ -214,6 +212,5 @@ def ticker_history():
"C": 8.877e-05,
"V": 7920.73570705,
"T": "2017-11-26T09:00:00",
"BV": 0.7039405
}
]