File tree Expand file tree Collapse file tree 1 file changed +20
-11
lines changed
Expand file tree Collapse file tree 1 file changed +20
-11
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments