hibana2077 commited on
Commit
1f9bc59
·
1 Parent(s): d94c51d

Enhance convert.py to save DataFrame as CSV; add load_test.py for testing Parquet file

Browse files
Files changed (2) hide show
  1. data/load_test.py +6 -0
  2. prepare/convert.py +3 -3
data/load_test.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import pandas as pd
2
+
3
+ file = "./train.parquet"
4
+
5
+ df = pd.read_parquet(file)
6
+ print(df.head())
prepare/convert.py CHANGED
@@ -53,9 +53,9 @@ def main():
53
  df.reset_index(drop=True, inplace=True)
54
  print(f"Total unique lines: {len(df)}")
55
  # Save to CSV
56
- # csv_path = "train.csv"
57
- # df.to_csv(csv_path, index=False)
58
- # print(f"CSV file created: {csv_path}")
59
 
60
  # Save to Parquet
61
  parquet_path = "train.parquet"
 
53
  df.reset_index(drop=True, inplace=True)
54
  print(f"Total unique lines: {len(df)}")
55
  # Save to CSV
56
+ csv_path = "train.csv"
57
+ df.to_csv(csv_path, index=False)
58
+ print(f"CSV file created: {csv_path}")
59
 
60
  # Save to Parquet
61
  parquet_path = "train.parquet"