我ValueError: Expected object or value
在尝试让熊猫读取我的json文件时遇到问题。
这是我正在使用的代码:
import pandas as pd
import json
dataframe = pd.read_json(r'C:\Users\stans\WFH Project\data.json')
这是我收到值错误的时间。我将json数据另存为扩展名为.json的文本文件。
这是一个示例:
{
'created_at': 'Thu Dec 24 10:09:36 +0000 2020',
'id': 1342049779233284097,
'id_str': '1342049779233284097',
'text': 'RT @ab: S2E13 IntelAI podcast—from #AI beating world chess champs to solving the grand research challenge known as the #protein…',
'truncated': False,
'entities': {
'hashtags': [{
'text': 'AI',
'indices': [47, 50]
}
我什至尝试将json文件保存在pwd中以查看是否是目录路径问题,但是我收到了相同的错误。任何帮助,将不胜感激。谢谢。
试试这个更新的JSON。我用替换了所有的,'
用"
替换False
了false
,并关闭了所有的数组/对象...
{
"created_at": "Thu Dec 24 10:09:36 +0000 2020",
"id": 1342049779233284097,
"id_str": "1342049779233284097",
"text": "RT @ab: S2E13 IntelAI podcast\u2014from #AI beating world chess champs to solving the grand research challenge known as the #protein\u2026",
"truncated": false,
"entities": {"hashtags": [{
"text": "AI",
"indices": [47, 50]
}]
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句