vmtmxmf5 / Pytorch-

pytorch로 머신러닝~딥러닝 구현
3 stars 0 forks source link

chunk 코드 #10

Open vmtmxmf5 opened 2 years ago

vmtmxmf5 commented 2 years ago
import pandas as pd
import json

with open('final.json', encoding='utf-8') as f:
    data = json.load(f)
    chunkSize = 1000
    for i in range(0, len(data), chunkSize):
        with open('final_' + str(i//chunkSize) + '.json', 'w') as outfile:
            json.dump(data[i:i+chunkSize], outfile)
import pandas as pd
import json
path = 'C:/Users/CPB06GameN/글을쓰자/PyTorch-master/연습폴더/final_chunk/'
with open(path+'final_20.json', encoding='utf-8') as f:
    data = json.load(f)