Skip to content

Commit

Permalink
Update for JHU dataset's new headers format
Browse files Browse the repository at this point in the history
  • Loading branch information
amphinomid authored Sep 25, 2022
1 parent 9dae392 commit c3d6b22
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion covid-prisons.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,19 @@ def load_covid_prison_data():
@st.cache
def load_covid_data():
covid_data = pd.read_csv(COVID_DATA_URL, nrows = 50,
names = ['Province_State','Country_Region','Last_Update','Lat','Long_','Confirmed','Deaths','Recovered',
'Active','FIPS','Incident_Rate','Total_Test_Results','People_Hospitalized','Case_Fatality_Ratio',
'UID','ISO3','Testing_Rate','Hospitalization_Rate','Date','People_Tested','Mortality_Rate'],
usecols = ['Province_State', 'Confirmed', 'Deaths', 'Incident_Rate', 'Mortality_Rate'],
skiprows = [0, 3, 10, 11, 14, 15, 40, 45, 53],
)
'''covid_data = pd.read_csv(COVID_DATA_URL, nrows = 50,
names = ['Province_State', 'Country_Region', 'Last_Update', 'Lat', 'Long_', 'Confirmed', 'Deaths', 'Recovered',
'Active', 'FIPS', 'Incident_Rate', 'People_Tested', 'People_Hospitalized', 'Mortality_Rate', 'UID',
'ISO3', 'Testing_Rate', 'Hospitalization_Rate'],
usecols = ['Province_State', 'Confirmed', 'Deaths', 'Incident_Rate', 'Mortality_Rate'],
skiprows = [0, 3, 10, 11, 14, 15, 40, 45, 53],
)
)'''
covid_data = covid_data.rename(columns = {'Incident_Rate': 'State_CR'})
covid_data = covid_data.rename(columns = {'Mortality_Rate': 'State_CFR'})
covid_data['State_CFR'] = covid_data['State_CFR'] * 1000
Expand Down

0 comments on commit c3d6b22

Please sign in to comment.