我的函数如下所示:
filename = 'orderbook_file.json'
def get_line():
f = open(filename, 'r')
n_display = 0
for line in f:
data = json.loads(line)
print(data)
#if n_display % 100: continue
n_display +=1
return data
我的json对象如下所示:
[
{
"asks" : [
[
0.00276477,
NumberInt(9)
]
],
"bids" : [
[
0.002755,
NumberInt(544)
]
],
"lastUpdated" : 1538582700048.0
},
{
"asks" : [
[
0.00276477,
NumberInt(9)
]
],
"bids" : [
[
0.002755,
NumberInt(544)
]
],
"lastUpdated" : 1538582700048.0
}
]
我在尝试加载json时收到了标题中的错误。该文件基本上是一个json对象数组。我对Json不是很熟悉,有什么帮助吗?谢谢
目前没有回答
相关问题 更多 >
编程相关推荐