Add number of further districts
This commit is contained in:
parent
3953d6d2ff
commit
14e314822d
11
wsgi.py
11
wsgi.py
@ -291,6 +291,7 @@ def _print_as_html(
|
|||||||
dropna: bool = True,
|
dropna: bool = True,
|
||||||
) -> list[str]:
|
) -> list[str]:
|
||||||
df = df.astype({"Digitale Befragung": "Int32"})
|
df = df.astype({"Digitale Befragung": "Int32"})
|
||||||
|
num_missing = (df[df.isna().any(axis=1)]["Landesbezirk"] != "Hessen").sum()
|
||||||
if dropna:
|
if dropna:
|
||||||
df = df.dropna()
|
df = df.dropna()
|
||||||
with pd.option_context("display.max_rows", None):
|
with pd.option_context("display.max_rows", None):
|
||||||
@ -315,11 +316,11 @@ def _print_as_html(
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
if total and (diff := total - df["Digitale Befragung"].sum()):
|
if total and (diff := total - df["Digitale Befragung"].sum()):
|
||||||
tfoot.extend(
|
tfoot.append(" <tr>")
|
||||||
[
|
tfoot.append(
|
||||||
" <tr>",
|
f" <td>Weitere Bezirke ({num_missing})</td>"
|
||||||
" <td>Weitere Bezirke</td>",
|
if num_missing
|
||||||
]
|
else f" <td>Weitere Bezirke</td>"
|
||||||
)
|
)
|
||||||
for i in range(len(df.columns) - 2):
|
for i in range(len(df.columns) - 2):
|
||||||
tfoot.append(" <td></td>")
|
tfoot.append(" <td></td>")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user