Skip to content

Commit

Permalink
Update covid-prisons.py
Browse files Browse the repository at this point in the history
  • Loading branch information
amphinomid authored Dec 30, 2022
1 parent efef6c3 commit 4c4aee2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions covid-prisons.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
def load_prison_pop_data():
prison_pop_data = pd.read_csv(PRISON_POP_DATA_URL,
names = ['name', 'abbreviation', 'month', 'as_of_date', 'pop'],
usecols = ['name', 'pop', 'as_of_date'],
usecols = ['name', 'as_of_date', 'pop'],
skiprows = 1,
)
prison_pop_data = prison_pop_data.drop_duplicates(subset = ['name'], keep = 'last')
Expand All @@ -25,7 +25,7 @@ def load_covid_prison_data():
usecols = ['name', 'total_prisoner_cases', 'total_prisoner_deaths', 'as_of_date'],
skiprows = 154, # Relatively recent with relatively few non-reporters (Delaware for cases and Maine and Nevada for deaths)
)
st.write(prison_pop_data)
st.write(prison_pop_data['pop'])
covid_prison_data['Prison_CR'] = covid_prison_data['total_prisoner_cases'] * 100000 / prison_pop_data['pop']
covid_prison_data['Prison_MR'] = covid_prison_data['total_prisoner_deaths'] * 100000 / prison_pop_data['pop']
covid_prison_data['Prison_CFR'] = covid_prison_data['total_prisoner_deaths'] * 100000 / covid_prison_data['total_prisoner_cases']
Expand Down

0 comments on commit 4c4aee2

Please sign in to comment.