Spaces:
Sleeping
Sleeping
Commit ·
6dd762f
1
Parent(s): b27ce04
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ import gradio as gr
|
|
| 5 |
def process_csv(input_file):
|
| 6 |
|
| 7 |
# Load the CSV file with MS932 encoding
|
| 8 |
-
df = pd.read_csv(input_file.name,
|
| 9 |
|
| 10 |
# Insert '行形式' column twice at the beginning
|
| 11 |
for _ in range(2):
|
|
@@ -52,7 +52,7 @@ def process_csv(input_file):
|
|
| 52 |
df_modified = pd.concat(dfs)
|
| 53 |
|
| 54 |
# Save the modified dataframe to the output file
|
| 55 |
-
output_file_path = "
|
| 56 |
df_modified.to_csv(output_file_path, index=False, encoding="MS932")
|
| 57 |
|
| 58 |
return output_file_path
|
|
|
|
| 5 |
def process_csv(input_file):
|
| 6 |
|
| 7 |
# Load the CSV file with MS932 encoding
|
| 8 |
+
df = pd.read_csv(input_file.name,header=0)
|
| 9 |
|
| 10 |
# Insert '行形式' column twice at the beginning
|
| 11 |
for _ in range(2):
|
|
|
|
| 52 |
df_modified = pd.concat(dfs)
|
| 53 |
|
| 54 |
# Save the modified dataframe to the output file
|
| 55 |
+
output_file_path = "processed.csv"
|
| 56 |
df_modified.to_csv(output_file_path, index=False, encoding="MS932")
|
| 57 |
|
| 58 |
return output_file_path
|