From c777530d26881552e6d361de125fdde945743f66 Mon Sep 17 00:00:00 2001 From: Dylan McDowell Date: Mon, 10 Jun 2024 15:40:24 -0600 Subject: [PATCH] Fix raw data script --- use_cases/2020_12/scripts/raw_data_proc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/use_cases/2020_12/scripts/raw_data_proc.py b/use_cases/2020_12/scripts/raw_data_proc.py index 4fef6ff5..4d49f51b 100755 --- a/use_cases/2020_12/scripts/raw_data_proc.py +++ b/use_cases/2020_12/scripts/raw_data_proc.py @@ -26,7 +26,7 @@ def read_workbook(file_path: Path) -> dict: io=DATA_DIR.joinpath(file_path.name), sheet_name=None, index_col=0, - engine='xlrd' + # engine='xlrd' ) @@ -83,7 +83,8 @@ def main(): for state in ["OH", "IL"]: for i, key in enumerate(YEARS): output_path = TRAIN_DIR.joinpath(case, state, f"Data_{i+1}.csv") - final_dat.loc[state, key, :].to_csv( + state_year_data = final_dat.loc[(state, key, slice(None)), :] + state_year_data.to_csv( path_or_buf=output_path, index_label=['STATE', 'YEAR', 'HOUR'] )