Skip to content

Commit 8317b8f

Browse files
committed
fix: fix file format
1 parent 1f5a65c commit 8317b8f

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

src/webapp/routers/data.py

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -925,9 +925,11 @@ def get_eda_data(
925925
(
926926
df_cohort["student_age"]
927927
if "student_age" in df_cohort.columns
928-
else df_cohort["age"]
929-
if "age" in df_cohort.columns
930-
else pd.Series([None] * len(df_cohort))
928+
else (
929+
df_cohort["age"]
930+
if "age" in df_cohort.columns
931+
else pd.Series([None] * len(df_cohort))
932+
)
931933
).apply(
932934
lambda x: (
933935
"20 or younger"
@@ -942,15 +944,22 @@ def get_eda_data(
942944
]
943945
)
944946
or (isinstance(x, (int, float)) and x <= 20)
945-
else "20 - 24"
946-
if any(
947-
term in str(x).lower()
948-
for term in ["20-24", "20 to 24", "20 - 24"]
949-
)
950-
or (
951-
isinstance(x, (int, float)) and 20 < x <= 24
947+
else (
948+
"20 - 24"
949+
if any(
950+
term in str(x).lower()
951+
for term in [
952+
"20-24",
953+
"20 to 24",
954+
"20 - 24",
955+
]
956+
)
957+
or (
958+
isinstance(x, (int, float))
959+
and 20 < x <= 24
960+
)
961+
else "Older than 24"
952962
)
953-
else "Older than 24"
954963
)
955964
)
956965
)

0 commit comments

Comments
 (0)