Skip to content

Commit

Permalink
upload: add jsonl_to_df
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenWrong committed Apr 28, 2024
1 parent 63b2af6 commit 4b62349
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions data_io.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import json
import pandas as pd


def jsonl_to_df(file_path: str) -> pd.DataFrame:
data = []
with open(file_path, 'r', encoding='utf-8') as file:
for line in file:
data.append(json.loads(line))
return pd.DataFrame(data)

0 comments on commit 4b62349

Please sign in to comment.