I'm trying to get variables of a live trading order book using the 'python-binance' library.
depth = client.get_order_book(symbol='BTCUSDT')
print(depth)
This is the result.
'bids': [['34657.70000000', '0.57150000'], ['34655.76000000', '0.00035500'], ['34654.28000000', '0.01431800'][...]
'asks': [['34657.70000000', '0.57150000'], ['34655.76000000', '0.00035500'], ['34654.28000000', '0.01431800'][...]
The first value of each row is the price and the second one is the volume.
I would like to unify all 'price' values and 'volume' values into separate variables, so I would be able to sum all prices and all volumes separately.
Tried to find a related example using numpy or pandas but as you see, I'm such a newbie.
Thank you all
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…