0

我已经尝试了下面的代码,但它不起作用

import json
with open("/Users/elton/20210228test2.ndjson") as f:
    test2data = ndjson.load(f)
4

1 回答 1

0

这对我有用。import ndjson而不是import json. 在此处查看更多信息:https ://pypi.org/project/ndjson/

import ndjson

# load from file-like objects
with open('data.ndjson') as f:
    data = ndjson.load(f)
于 2021-03-24T14:08:26.883 回答