I want to get some part of information from API, but I don't know how to filter data (I want to get only chosen values and don't get values if key don't contain "BTC" string) I'm trying to do something like this:
{"BTC_MINT":{"volume":11.00, "high24":0.002, "low24":0.001},
"BTC_NOTE":{"volume":11.00, "high24":0.002, "low24":0.001}}
I started with pandas, but I don't know if is it proper way.
link = 'https://poloniex.com/public?command=returnTicker'
with urllib.request.urlopen(link) as rawdata:
data = rawdata.readall().decode()
data = json.loads(data)
print(data.items())
data = pd.DataFrame([[cur, last, volume, high24, low24]
for cur, d in data.items()
for last, x, x, x, volume, x, x, high24, low24 in d.items()])
Unfortunately, this code don't work. I get following error:
[cur, last, volume, high24, low24] for cur, d, x, w, d, q in data.items() for last, x, x, x, volume, x, x, high24, low24 in d.items()
ValueError: need more than 2 values to unpack
Could someone help and tell me how should I do it?