我有这样的txt
文件格式:
[{
"lng": "111.68389897298637",
"odometer": 0,
"busSpeed": "0.00",
"relativeLocation": 0,
"realTimeStatus": "0",
"driverUuid": "28b3ea130a6ad049a10b041037e2550d80f5",
"posUuid": "8eba1ae2fd014eaf948b",
"cursorOverGround": "0",
"posIsInStation": "",
"sationName": "",
"distanceToPrePosition": 0,
"lineUuid": "c2e0313000fba04c940a4be0f9edb9c521c8",
"drvIcCard": "3168310624",
"lineType": "0",
"isOffset": "1",
"driverName": "贾爱俊",
"gatherTime": 1506468898000,
"allAlarms": "7",
"busUuid": "9d9648ff0375a04702080cc03a4c20377ea8",
"lat": "40.86856137377131",
"devUuid": "3d16fedb858842199cb3",
"sationUuid": ""
}, {
"lng": "111.68364330061954",
"odometer": 0,
"busSpeed": "11.00",
"relativeLocation": 0,
"realTimeStatus": "0",
"driverUuid": "28b3ea130a6ad049a10b041037e2550d80f5",
"posUuid": "ff42c6cca2e14583b84f",
"cursorOverGround": "280",
"posIsInStation": "",
"sationName": "",
"distanceToPrePosition": 0,
"lineUuid": "c2e0313000fba04c940a4be0f9edb9c521c8",
"drvIcCard": "3168310624",
"lineType": "0",
"isOffset": "1",
"driverName": "贾爱俊",
"gatherTime": 1506468919000,
"allAlarms": "7",
"busUuid": "9d9648ff0375a04702080cc03a4c20377ea8",
"lat": "40.868510932496115",
"devUuid": "3d16fedb858842199cb3",
"sationUuid": ""
}]
当我想将其导入数据帧时,我只得到一列:
但是当我选择一些txt
列表时,我可以得到正确的答案:
有人能告诉我如何正确地使用txt
文件吗?感谢您的帮助!谢谢。你知道吗
你需要^{} 。完成下面的示例。你知道吗
设置
解决方案
结果
不能写评论,因此必须写一个答案。你知道吗
请先查看以下链接:
https://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_table.htmlhttps://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_csv.html
您很可能需要检查delimiter/sep和header参数,才能将文件正确地解析为数据帧。你知道吗
请提供一个最低限度的代码示例,说明您到目前为止尝试了什么,或者是什么代码导致了您的问题。你知道吗
只要将上面的示例与python中已有的列表一起使用就可以了:
相关问题 更多 >
编程相关推荐