Die JSON Datei sieht wie folgt aus:
Code: Alles auswählen
"code":"200000",
"data":[
{
"price":"1001",
"sequence":"1636607335665",
"side":"sell",
"size":"0.00000544",
"time":1657828843154264094
},
{
"price":"5538.9",
"sequence":"1636607335668",
"side":"buy",
"size":"0.00000098",
"time":1657828843399526634
},
{
"price":"1001",
"sequence":"1636607335707",
"side":"sell",
"size":"0.00000098",
"time":1657828850316727168
},
Mein Code der funktioniert:
Code: Alles auswählen
# importing pandas library
import pandas as pd
# importing matplotlib library
import matplotlib.pyplot as plt
# creating dataframe
df = pd.DataFrame({
'X': [1, 2, 3, 4, 5],
'Y': [2, 4, 6, 10, 15]
})
# plotting a line graph
print("Line graph: ")
plt.plot(df["X"], df["Y"])
plt.show()