This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 참조 https://sooeun67.github.io/data%20science/convert-pandas-to-ndjson/ | |
df = pd.read_csv(f'{target_file}.csv') | |
df.to_json(f'{target_file}.json', orient="records", lines=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://sooeunoh.tistory.com/7 | |
with open(os.path.join({FILE_PATH}, {ITEM_FILE}), encoding='utf-8-sig') as f: # 한글 데이터인 경우 encoding 설정 | |
data = ndjson.load(f) # ndjson 으로 읽고 | |
org_data = pd.DataFrame(data) |