diff --git a/wsgi.py b/wsgi.py index 7d9d8c4..e7ce794 100644 --- a/wsgi.py +++ b/wsgi.py @@ -291,11 +291,19 @@ def _print_as_html( dropna: bool = True, ) -> list[str]: df = df.astype({"Digitale Befragung": "Int32"}) - missing_df = df[["Digitale Befragung"]].isna().join(df[["Landesbezirk"]]).groupby("Landesbezirk").sum() + missing_df = ( + df[["Digitale Befragung"]] + .isna() + .join(df[["Landesbezirk"]]) + .groupby("Landesbezirk") + .sum() + ) total = df_state["Digitale Befragung"].sum() if df_state is not None else None if df_state is not None: - for idx, row in missing_df.loc[missing_df["Digitale Befragung"] == 1].iterrows(): + for idx, row in missing_df.loc[ + missing_df["Digitale Befragung"] == 1 + ].iterrows(): df_tmp = df.loc[df["Landesbezirk"] == idx] df_state_tmp = df_state.loc[df_state["Landesbezirk"] == idx] missing_idx = df_tmp.loc[df_tmp.isna().any(axis=1)].iloc[0].name @@ -334,7 +342,7 @@ def _print_as_html( ) if total and (diff := total - df["Digitale Befragung"].sum()): tfoot.append("