From 6f29bdc6da3e2291287e52c8758ca24557b6b3b2 Mon Sep 17 00:00:00 2001 From: Felix Blanke Date: Mon, 28 Aug 2023 12:12:08 +0200 Subject: [PATCH] Fix index col for read data --- wsgi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wsgi.py b/wsgi.py index 921af3e..157aa94 100644 --- a/wsgi.py +++ b/wsgi.py @@ -51,7 +51,7 @@ def create_plot_df( for f in sorted(Path(data_folder).iterdir()): with f.open("rb") as ff: - df = pd.read_excel(ff, sheet_name=sheet_name) + df = pd.read_excel(ff, sheet_name=sheet_name, index_col=0) df = df.astype({"Digitale Befragung": "Int32"}) sum_val = df[["Digitale Befragung"]].sum().iloc[0] key = f.name[:10] @@ -224,11 +224,11 @@ def tables( key = last_file.name[:10] with (Path("data") / f"{key}_data.ods").open("rb") as ff: - df = pd.read_excel(ff, sheet_name="digital").astype( + df = pd.read_excel(ff, sheet_name="digital", index_col=0).astype( {"Digitale Befragung": "Int32"} ) with (Path("data") / f"{key}_state_data.ods").open("rb") as ff: - df_state = pd.read_excel(ff, sheet_name="digital").astype( + df_state = pd.read_excel(ff, sheet_name="digital", index_col=0).astype( {"Digitale Befragung": "Int32"} )