pandas.read_json在为大型数据集解码'string'时给出ValueError:无法识别的转义序列

时间:2017-12-10 05:37:10

标签: json pandas

在大型数据集(1.26GB)上使用pd.read_json时,我收到错误消息ValueError: Unrecognized escape sequence when decoding 'string' 由于无法更改每个转义序列,如何将此文件解析为json?

这会导致此行出错 {"text": "I'm always looking for a good Eggs Benny. This usually leads me to major hotel restaurants, but you can always find a good representation at a smaller independent restaurant.\n\nSteve's is a spacious restaurant just south of the 407, and worth a quick detour to get a well executed b, reakfast. Nicely poached eggs, a tasty chunk of pea meal bacon on an English muffin, smothered in Hollandaise. With a generous portion of home fries, it's a meal that carries me through most of the day.\n\nEggs Benedict: that's what I came for and it was worth the short deviation. Become a deviant yourself!", "id": 81164}

1 个答案:

答案 0 :(得分:0)

我将整个文件拆分为较小的文件并将它们一起添加。在执行此操作时引入了换行符,导致上述错误发生。