Skip to content

Commit

Permalink
GA pharmacy script.
Browse files Browse the repository at this point in the history
  • Loading branch information
fensorechase committed Jan 29, 2024
1 parent a95e7a8 commit 38a2992
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions compress_pharma.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import json
import pandas as pd


tmp = pd.read_csv("pharmacy_ga.csv")
tmp.zipcode = tmp.zipcode.astype(int)

tmp_gp = tmp[tmp.source == 'gp']
agg_gp = tmp_gp.groupby(by=["zipcode"]).count()
agg_json = agg_gp.to_dict()

with open("zipdata.json", "w") as outfile:
outfile.write(json.dumps(agg_json["census"]))

0 comments on commit 38a2992

Please sign in to comment.