I am trying to convert a json payload with no keys into a Pandas Dataframe. Below is what I have now
import requests
import pandas as pd
r = requests.get("https://api.pro.coinbase.com/products/BTC-USD/candles")
df = pd.read_json(r.json()).columns = ["time", "low", "high", "open", "close", "volume"]
print(df)
The request returns a payload like this...
[
[
1613256660,
47077.61,
47103.32,
47100,
47084.96,
1.6661533
],
...
]
pd.DataFrame(r.json(), columns = ["time", "low", "high", "open", "close", "volume"])will work