我有许多数据文件是以类似dict的格式编写的:
{"score": [0.9995803236961365, 0.00041968212462961674], "key": "Am2mVTMbhd0y", "label": "0"}
{"score": [0.9997120499610901, 0.00028794570243917406], "key": "AmG8StB8hM2k", "label": "0"}
{"score": [0.8841496109962463, 0.11585044860839844], "key": "Alt137zv2nY6", "label": "0"}
{"score": [0.9999467134475708, 5.334055458661169e-05], "key": "AmGdF7cY4X22", "label": "0"}
我想做的是将它们导入pandas,列为'key'、'label'和'score'——并且必须将这两个数值放在不同的列中。我尝试将文件作为dict导入,但得到:
ValueError: too many values to unpack
有什么建议可以解决这个问题吗
我想你需要参数} :
lines=True
在^{要将} 的
lists
转换为列,请使用带有^{DataFrame
构造函数:相关问题 更多 >
编程相关推荐