Python Forum
I keep getting the same error over and over again.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I keep getting the same error over and over again.
#6
You could set breakpoints in your debugger and look at ohc_data after it is returned but before you create df.

If you are not comfortable using a debugger you could modify the code to check if olhc_data contains a result key.
if 'result' in olhc_data:
If 'result' is not on ohlc_data, print the dictionary, or the dictionary keys and quit, otherwise process the result as before.
if 'result' not in olhc_data:
    print(ohlc_data)  # Try one of these
    print(list(ohlc_data.keys())
    quit()
And if you don't like doing that, you can run python and enter these lines one at a time.
import krakenex
api = krakenex.API()
data = api.query_public('OHLC', {'pair': 'XBT/USD', 'interval': 1440})
data  # will print dictionary
Reply


Messages In This Thread
RE: I keep getting the same error over and over again. - by deanhystad - Apr-19-2023, 01:43 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020