update eligiblePopulation because now 16+ can now be vaccinated

main
Ray Slakinski 2 years ago
parent 65ec23930e
commit 0b154a8251
  1. 22
      contrib/ages.csv
  2. 12
      contrib/calc_eligible_population.py
  3. 2
      main.go

@ -0,0 +1,22 @@
"All ages","14,734,014"
"0 to 4 years","723,016"
"5 to 9 years","762,654"
"10 to 14 years","792,947"
"15 to 19 years","852,405"
"20 to 24 years","1,039,661"
"25 to 29 years","1,077,433"
"30 to 34 years","1,041,952"
"35 to 39 years","992,844"
"40 to 44 years","921,378"
"45 to 49 years","932,058"
"50 to 54 years","968,546"
"55 to 59 years","1,073,519"
"60 to 64 years","961,243"
"65 to 69 years","803,962"
"70 to 74 years","673,546"
"75 to 79 years","461,015"
"80 to 84 years","319,548"
"85 to 89 years","204,227"
"90 to 94 years","98,638"
"95 to 99 years","29,527"
"100 years and over","3,895"
1 All ages 14,734,014
2 0 to 4 years 723,016
3 5 to 9 years 762,654
4 10 to 14 years 792,947
5 15 to 19 years 852,405
6 20 to 24 years 1,039,661
7 25 to 29 years 1,077,433
8 30 to 34 years 1,041,952
9 35 to 39 years 992,844
10 40 to 44 years 921,378
11 45 to 49 years 932,058
12 50 to 54 years 968,546
13 55 to 59 years 1,073,519
14 60 to 64 years 961,243
15 65 to 69 years 803,962
16 70 to 74 years 673,546
17 75 to 79 years 461,015
18 80 to 84 years 319,548
19 85 to 89 years 204,227
20 90 to 94 years 98,638
21 95 to 99 years 29,527
22 100 years and over 3,895

@ -0,0 +1,12 @@
import csv
ages = []
with open("ages.csv", newline="") as csvfile:
spamreader = csv.reader(csvfile, delimiter=",", quotechar='"')
for row in spamreader:
ages.append(row)
total = 0
for age in ages[4:]:
total += int(age[1].replace(",", ""))
print(total)

@ -64,7 +64,7 @@ func init() {
func updateMetrics() {
data_url := "https://data.ontario.ca/api/3/action/datastore_search?sort=report_date+desc&limit=1&resource_id=8a89caa9-511c-4568-af89-7f2174b4378c"
eligiblePopulation := int64(11971129)
eligiblePopulation := int64(12455397)
resp, getErr := http.Get(data_url)
if getErr != nil {
log.Println(getErr)

Loading…
Cancel
Save