【发布时间】:2018-09-16 01:46:46
【问题描述】:
试图将这个大的 json 转换成 csv。这里是示例 JSON
[
[{
"User": "Phoebe",
"text": "Oh my God, hes lost it. Hes totally lost it.",
"sent": "non-neutral"
},
{
"user": "Monica",
"text": "What?",
"sent": "surprise"
}
],
[{
"user": "Joey",
"text": "Hey Estelle, listen",
"sent": "neutral"
},
{
"user": "Estelle",
"text": "Well! Well! Well! Joey Tribbiani! So you came back huh? They",
"sent": "surprise"
}
]
]
with open('/Users/dsg281/Downloads/EmotionLines/Friends/friends_dev.json') as data_file:
data = json.load(data_file)
我正在尝试在 csv 中使用 "User"、"text"、"sent"
【问题讨论】:
-
再检查一下,这是不正确的数据。
-
这不是有效的 JSON
-
@RahulNLP 这是帮助您尝试它stackoverflow.com/questions/1871524/…
-
@Harry_pb 我已经更正了 Json 格式。请看一下
标签: python python-3.x python-2.7 pandas