我的 JSON (~500mb) 文件有多个 JSON objetcs,实际上我只需要使用“customer_id”列。当我执行下面的代码时,它会出现内存错误。
with open('online_pageviews.json') as f:
online_pageviews = pd.DataFrame(json.loads(line) for line in f)
Run Code Online (Sandbox Code Playgroud)
这是“online_pageviews.json”中的 JSON 对象示例
{
"date": "2018-08-01",
"visitor_id": "3832636531373538373137373",
"deviceType": "mobile",
"pageType": "product",
"category_id": "6365313034",
"on_product_id": "323239323839626",
"customer_id": "33343163316564313264"
}
Run Code Online (Sandbox Code Playgroud)
有没有办法只使用“customer_id”列?我该怎么做才能加载这个文件?