mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-07-28 05:51:17 -07:00
1295-college-attendance-field (#1297)
Lucas' work. Adding college attendance to tiles.
This commit is contained in:
parent
e48ab86b85
commit
6e64134dc6
8 changed files with 25 additions and 7 deletions
|
@ -375,6 +375,10 @@ SCORE_M_LOW_INCOME_SUFFIX = (
|
|||
", is low income, and has a low percent of higher ed students"
|
||||
)
|
||||
|
||||
COLLEGE_ATTENDANCE_LESS_THAN_20_FIELD = (
|
||||
"Percent higher ed enrollment rate is less than 20%"
|
||||
)
|
||||
|
||||
# Climate Change
|
||||
EXPECTED_POPULATION_LOSS_RATE_LOW_INCOME_LOW_HIGHER_ED_FIELD = (
|
||||
f"Greater than or equal to the {PERCENTILE}th percentile"
|
||||
|
|
|
@ -92,6 +92,7 @@ class ScoreM(Score):
|
|||
of booleans based on the condition of the FPL at 200%
|
||||
is at or more than some established threshold
|
||||
"""
|
||||
|
||||
return (
|
||||
(
|
||||
df[
|
||||
|
@ -101,10 +102,7 @@ class ScoreM(Score):
|
|||
>= self.LOW_INCOME_THRESHOLD
|
||||
)
|
||||
) & (
|
||||
(
|
||||
df[field_names.COLLEGE_ATTENDANCE_FIELD]
|
||||
<= self.MAX_COLLEGE_ATTENDANCE_THRESHOLD
|
||||
)
|
||||
df[field_names.COLLEGE_ATTENDANCE_LESS_THAN_20_FIELD]
|
||||
| (
|
||||
# If college attendance data is null for this tract, just rely on the
|
||||
# poverty data
|
||||
|
@ -732,6 +730,17 @@ class ScoreM(Score):
|
|||
logger.info("Adding Score M")
|
||||
|
||||
self.df[field_names.THRESHOLD_COUNT] = 0
|
||||
|
||||
# TODO: move this inside of
|
||||
# `_create_low_income_and_low_college_attendance_threshold`
|
||||
# and change the return signature of that method.
|
||||
# Create a standalone field that captures the college attendance boolean
|
||||
# threshold.
|
||||
self.df[field_names.COLLEGE_ATTENDANCE_LESS_THAN_20_FIELD] = (
|
||||
self.df[field_names.COLLEGE_ATTENDANCE_FIELD]
|
||||
<= self.MAX_COLLEGE_ATTENDANCE_THRESHOLD
|
||||
)
|
||||
|
||||
self.df[
|
||||
field_names.FPL_200_AND_COLLEGE_ATTENDANCE_SERIES
|
||||
] = self._create_low_income_and_low_college_attendance_threshold(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue