valueError (timeframe) when using get_ohlc_data()
Closed this issue · 1 comments
kitt-th commented
Hello, when running the basic test code shown on the main page of the distro:
api = krakenex.API()
k = KrakenAPI(api)
ohlc, last = k.get_ohlc_data("BCHUSD")
print(ohlc)
The following error is raised.
Traceback (most recent call last):
File "/Users/gg/opt/anaconda3/lib/python3.7/site-packages/pandas/core/arrays/datetimelike.py", line 893, in _validate_frequency
raise ValueError
ValueError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "fatFingerKraken.py", line 101, in <module>
ohlc, last = k.get_ohlc_data("BCHUSD")
File "/Users/gg/opt/anaconda3/lib/python3.7/site-packages/pykrakenapi/pykrakenapi.py", line 53, in wrapper
result = func(*args, **kwargs)
File "/Users/gg/opt/anaconda3/lib/python3.7/site-packages/pykrakenapi/pykrakenapi.py", line 100, in wrapper
result = func(*args, **kwargs)
File "/Users/gg/opt/anaconda3/lib/python3.7/site-packages/pykrakenapi/pykrakenapi.py", line 602, in get_ohlc_data
ohlc.index.freq = str(interval) + 'T'
File "/Users/gg/opt/anaconda3/lib/python3.7/site-packages/pandas/core/indexes/datetimelike.py", line 100, in freq
self._data.freq = value
File "/Users/brian/opt/anaconda3/lib/python3.7/site-packages/pandas/core/arrays/datetimelike.py", line 831, in freq
self._validate_frequency(self, value)
File "/Users/gg/opt/anaconda3/lib/python3.7/site-packages/pandas/core/arrays/datetimelike.py", line 907, in _validate_frequency
infer=inferred, passed=freq.freqstr
ValueError: Inferred frequency -1T from passed values does not conform to passed frequency T
Any help poss on how to fix this? Cheers
dominiktraxl commented
Hi there, thanks for pointing me to that bug. It's resolved now, please download the new version (0.2.1).