簡體   English   中英

將50 GB的JSON處理到Pandas Dataframe中

[英]Processing 50 GB of JSON into Pandas Dataframe

我有大約50 GB的6,000個JSON文件,目前正在使用以下方法將其加載到pandas數據框中。 format_pandas函數在讀取每個JSON行時設置了我的熊貓數據框):

path = '/Users/shabina.rayan/Desktop/Jupyter/Scandanavia Weather/Player  Data'
records = []
for filename in glob.glob(os.path.join(path, '*.JSON')):
    file = Path(filename)
    with open(file) as json_data:
        j = json.load(json_data)
        format_pandas(j)
pandas_json = json.dumps(records)
df = pd.read_json(pandas_json,orient="records")

可以猜到,這需要花費很長時間才能處理我的數據。 有人對我可以處理50 GB的JSON文件並進行可視化/分析的其他方式有任何建議嗎?

將其轉儲到Elasticsearch中並根據需要運行查詢。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM