weixin_30141733
2021-04-09 21:03
采纳率: 100%
浏览 147
已采纳

python小白,字典列表嵌套,取值

best_ask=data["data"][0]["ask"][0][0]

 

 

{'table': 'spot/depth5', 'data': [{'asks': [['58546.7', '0.10271386', '16'], ['58553.4', '0.00144646', '2'], ['58553.5', '0.01', '1'], ['58553.7', '0.01069735', '1'], ['58556.1', '0.02', '1']], 'bids': [['58546.6', '4.1501877', '13'], ['58542.5', '0.0005', '1'], ['58542.3', '0.00125063', '2'], ['58542.2', '0.01118886', '1'], ['58541.9', '0.06602155', '1']], 'instrument_id': 'BTC-USDT', 'timestamp': '2021-04-09T12:28:02.680Z'}]}

 

 

 

请教,为什么取不到58546.7这个值呢??

1条回答 默认 最新

相关推荐 更多相似问题