diff --git a/main.py b/main.py index 946aa01..c946469 100644 --- a/main.py +++ b/main.py @@ -23,5 +23,6 @@ def delete_headers(df, line_number): dfs = [delete_headers(x, 2) for x in dfs[1:]] dfs.insert(0, first_df) merged_df = pd.concat(dfs).replace('\n', '', regex=True).replace('\r', '', regex=True).replace('\r\n', '', regex=True).replace('\n\r', '', regex=True) - result_df = merged_df.dropna(subset=[0]) - result_df.to_csv(f"./output_files/{i}_{PREFECTURES[i-1]}.csv", header=False, index=False) + result_df = merged_df.dropna(subset=[0]).dropna(axis=1) + prefecture_number = str(i).zfill(2) + result_df.to_csv(f"./output_files/{prefecture_number}_{PREFECTURES[i-1]}.csv", header=False, index=False)