I'm new to python and i successfully extract the 'symbol' and 'ask' value, but in the json, 'ask' has 2 values, i only want to get the first part before the comma. I tried to find the awnser on the forum, but it never match my problem.
here is my code
exchange2 = requests.get("https://ascendex.com/api/pro/v2/futures/ticker") e = exchange2.json() exchange2 = json_normalize(e['data']) exchange2['symbol'] = exchange2['symbol'].str.replace('-PERP', 'USDT') exchange2 = pd.DataFrame(exchange2, columns=['symbol', 'ask']) print (exchange2)
the result is
symbol ask 0 SHIBUSDT [0.00001077, 3996990] 1 VETUSDT [0.03033, 953000]
My expected result is this
symbol ask 0 SHIBUSDT 0.00001077 1 VETUSDT 0.03033