Python 加载json时出错?键必须是字符串

Python 加载json时出错?键必须是字符串,python,json,python-3.x,pandas,dataframe,Python,Json,Python 3.x,Pandas,Dataframe,试图读取我的json数据,但在使用pandas时显示此错误 import pandas as pd data=pd.read_json(r"1_lines.json") print(data) 错误 我的儿子 {1: [((86, 27, 169, 50), 'PSEG'), ((323, 33, 408, 41), 'Total amount due'), ((499, 26, 591, 44), '$26,930.17'), ((85, 53, 195, 63), 'W

试图读取我的json数据,但在使用pandas时显示此错误

import pandas as pd
data=pd.read_json(r"1_lines.json")
print(data)
错误

我的儿子

{1: [((86, 27, 169, 50), 'PSEG'), ((323, 33, 408, 41), 'Total amount due'), ((499, 26, 591, 44), '$26,930.17'), ((85, 53, 195, 63), 'We make things work for you.')], 
2: [((427, 24, 560, 31), ' LLC'), ((422, 35, 560, 42), 'Your account number: 4246'), ((454, 44, 560, 50), 'Invoice Number: 60438'), ((53, 82, 170, 93), 't Metering Program')]}
当使用其他代码时

import json
json_data= open("1_lines.json").read()
json_obj=json.loads(json_data)
print(json_obj)
错误


你的my_json是用词而不是json。T0从字典转换json

import json
a=json.dumps(my_json)

因为你的JSON格式是错误的。请在以下网站中验证您的json。json键也必须是sting。在每个字符串值中使用双引号。
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)```
import json
a=json.dumps(my_json)