Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #705 from KamalSinghKhanna/644
Browse files Browse the repository at this point in the history
fixes country names
  • Loading branch information
anomal authored Jul 20, 2021
2 parents d19134e + 2a60d1d commit ef9ec0e
Show file tree
Hide file tree
Showing 2 changed files with 22,183 additions and 7,468 deletions.
29,625 changes: 22,170 additions & 7,455 deletions _notebooks/2021-04-03-canada-variants-of-concern.ipynb

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions _notebooks/canada_voc.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ def get_area(prov):
dfclean["Province"] = dfclean.apply(lambda r: get_province(r["prov"]), axis=1)
dfclean["Area"] = dfclean.apply(lambda r: get_area(r["prov"]), axis=1)

dfuk = dfclean.copy()
dfuk["Variant"] = "B.1.1.7 (UK)"
dfuk["Count"] = dfuk["b117"]
dfAlpha = dfclean.copy()
dfAlpha["Variant"] = "B.1.1.7 (Alpha)"
dfAlpha["Count"] = dfAlpha["b117"]

dfsa = dfclean.copy()
dfsa["Variant"] = "B.1.351 (South Africa)"
dfsa["Count"] = dfsa["b1351"]
dfBeta = dfclean.copy()
dfBeta["Variant"] = "B.1.351 (Beta)"
dfBeta["Count"] = dfBeta["b1351"]

dfbr = dfclean.copy()
dfbr["Variant"] = "P.1 (Brazil)"
dfbr["Count"] = dfbr["p1"]
dfGamma = dfclean.copy()
dfGamma["Variant"] = "P.1 (Gamma)"
dfGamma["Count"] = dfGamma["p1"]

dfvoc = dfuk.append(dfsa).append(dfbr)
dfvoc = dfAlpha.append(dfBeta).append(dfGamma)

dfvocmax = dfvoc.groupby(["Province", "Variant"]).max().reset_index() \
[["Province", "Variant", "Count"]] \
Expand Down Expand Up @@ -120,7 +120,7 @@ def create_table(variant):
df_variant = join(df_variant, "CA", variant)
return df_variant.set_index(date_name).sort_values(by=[date_name], ascending=[False]).round().astype(int)

df_uk = create_table("b117")
df_sa = create_table("b1351")
df_br = create_table("p1")
df_Alpha = create_table("b117")
df_Beta = create_table("b1351")
df_Gamma = create_table("p1")

0 comments on commit ef9ec0e

Please sign in to comment.