Skip to content

Commit

Permalink
try to prevent contact plot going to zero
Browse files Browse the repository at this point in the history
  • Loading branch information
djay committed Sep 20, 2021
1 parent 6b69266 commit 3cc5592
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ To see cases for every province go to [The Researcher Covid Tracker](https://cov
([OWID IHME](https://ourworldindata.org/grapher/daily-new-estimated-covid-19-infections-ihme-model?country=~THA))
- [LSHTM Model](https://epiforecasts.io/covid/posts/national/thailand/).
- [OWID Covid Models for Thailand](https://ourworldindata.org/grapher/daily-new-estimated-infections-of-covid-19?country=~THA) lets you compare these infection estimates.
- [IHME Policy Briefing PDFs](http://www.healthdata.org/covid/updates) provide a lot of detail on the current situation in a country and what factors are that drive their predictions.
- Sources: [CCSA Daily Briefing](downloads#dl-briefings), [Covid IFR Analysis](http://epimonitor.net/Covid-IFR-Analysis.htm), [Thailand population by Age](http://statbbi.nso.go.th/staticreport/Page/sector/EN/report/sector_01_11101_EN_.xlsx)


Expand Down
7 changes: 4 additions & 3 deletions covid_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,8 @@ def clean_vac_leg(c, first="(1 Jab)", second="(2 Jabs)"):
' 2', " " + second).replace(
'Given 3', "3rd Booster").replace(
'Risk: Location', 'Aged 18-59').replace(
'All', 'Staff & Volunteers'
'All', 'Staff & Volunteers').replace(
'Risk: Disease', 'Risk Disease under 60'
)

groups = [c for c in df.columns if str(c).startswith('Vac Group')]
Expand Down Expand Up @@ -1030,7 +1031,7 @@ def clean_vac_leg(c, first="(1 Jab)", second="(2 Jabs)"):
cases_pivot = cases_pivot.reindex(all_days).fillna(0) # put in missing days with NaN
cases = cases.set_index(["Date", "Province"]).combine_first(cases_pivot.unstack().to_frame("Cases"))
cases = join_provinces(cases, "Province", ["Health District Number", "region"]) # to fill in missing health districts
cases = cases.fillna(0) # all the other values
# cases = cases.fillna(0) # all the other values
ifr = get_ifr()
cases = cases.join(ifr[['ifr', 'Population', 'total_pop']], on="Province")

Expand Down Expand Up @@ -1197,7 +1198,7 @@ def top(func, _):
cols = rearrange([f'Deaths Area {area}' for area in DISTRICT_RANGE], *FIRST_AREAS)
plot_area(df=df, png_prefix='deaths_by_area', cols_subset=cols,
title='Thailand Covid Deaths by health District', legends=AREA_LEGEND,
kind='area', stacked=True, percent_fig=False, ma_days=7, cmap='tab20')
kind='area', stacked=True, percent_fig=True, ma_days=7, cmap='tab20')

# Work out Death ages from CFR from situation reports
age_ranges = ["15-39", "40-59", "60-"]
Expand Down

0 comments on commit 3cc5592

Please sign in to comment.