Fix index col for read data

This commit is contained in:
Felix Blanke 2023-08-28 12:12:08 +02:00
parent 7aca691596
commit 6f29bdc6da

View File

@ -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"}
)