Fix index col for read data
This commit is contained in:
parent
7aca691596
commit
6f29bdc6da
6
wsgi.py
6
wsgi.py
@ -51,7 +51,7 @@ def create_plot_df(
|
|||||||
|
|
||||||
for f in sorted(Path(data_folder).iterdir()):
|
for f in sorted(Path(data_folder).iterdir()):
|
||||||
with f.open("rb") as ff:
|
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"})
|
df = df.astype({"Digitale Befragung": "Int32"})
|
||||||
sum_val = df[["Digitale Befragung"]].sum().iloc[0]
|
sum_val = df[["Digitale Befragung"]].sum().iloc[0]
|
||||||
key = f.name[:10]
|
key = f.name[:10]
|
||||||
@ -224,11 +224,11 @@ def tables(
|
|||||||
key = last_file.name[:10]
|
key = last_file.name[:10]
|
||||||
|
|
||||||
with (Path("data") / f"{key}_data.ods").open("rb") as ff:
|
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"}
|
{"Digitale Befragung": "Int32"}
|
||||||
)
|
)
|
||||||
with (Path("data") / f"{key}_state_data.ods").open("rb") as ff:
|
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"}
|
{"Digitale Befragung": "Int32"}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user