Browse Source

modified load.py to look in source_data folder and created two more date csv

kc-covid19-zipcode
prasket 2 months ago
parent
commit
94b194c46f
3 changed files with 172 additions and 2 deletions
  1. +2
    -2
      load_db.py
  2. +85
    -0
      source_data/covid-19_20200824_zip.csv
  3. +85
    -0
      source_data/covid-19_20200831_zip.csv

+ 2
- 2
load_db.py View File

@@ -8,8 +8,8 @@ cur = conn.cursor()

# take the source data csv and upload to the database.
# hardcoded to 20200810 right now
data_date = "20200810"
source_file = "covid-19_" +data_date+"_zip.csv"
data_date = "20200831"
source_file = "./source_data/covid-19_" +data_date+"_zip.csv"

with open(source_file, 'r') as f:
reader = csv.reader(f)


+ 85
- 0
source_data/covid-19_20200824_zip.csv View File

@@ -0,0 +1,85 @@
Location_Name,Population,Tests,Test_Rate,Positives,Positive_Rate,Hospitalizations,Hospitalization_Rate,Deaths,Death_Rate
00000,2226300,343578, 15432.69,18824, 845.53,2182, 98.01,711, 31.94
98001,35948,5107, 142.07,435, 12.10,43, 1.20,7, 0.19
98002,35106,6236, 177.63,649, 18.49,71, 2.02,13, 0.37
98003,49587,8287, 167.12,971, 19.58,91, 1.84,19, 0.38
98004,34755,6552, 188.52,232, 6.68,32, 0.92,11, 0.32
98005,20154,2810, 139.43,121, 6.00,16, 0.79,0, 0.00
98006,38904,5409, 139.03,148, 3.80,14, 0.36,4, 0.10
98007,28612,3027, 105.79,175, 6.12,27, 0.94,11, 0.38
98008,26113,3517, 134.68,220, 8.42,39, 1.49,16, 0.61
98010,5549,729, 131.38,31, 5.59,1, 0.18,1, 0.18
98011,34504,4135, 119.84,161, 4.67,27, 0.78,12, 0.35
98014,7630,976, 127.92,21, 2.75,3, 0.39,0, 0.00
98019,12209,1449, 118.68,37, 3.03,0, 0.00,1, 0.08
98022,22792,2778, 121.88,145, 6.36,32, 1.40,25, 1.10
98023,50842,7271, 143.01,570, 11.21,52, 1.02,8, 0.16
98024,6000,803, 133.83,20, 3.33,1, 0.17,0, 0.00
98027,30108,4958, 164.67,221, 7.34,45, 1.49,25, 0.83
98028,23193,3735, 161.04,143, 6.17,28, 1.21,9, 0.39
98029,29254,4538, 155.12,107, 3.66,12, 0.41,12, 0.41
98030,36849,5599, 151.94,648, 17.59,65, 1.76,23, 0.62
98031,39076,6335, 162.12,560, 14.33,57, 1.46,16, 0.41
98032,36699,6304, 171.78,639, 17.41,45, 1.23,11, 0.30
98033,38814,6632, 170.87,218, 5.62,23, 0.59,7, 0.18
98034,44252,7018, 158.59,408, 9.22,102, 2.30,56, 1.27
98038,35227,4774, 135.52,163, 4.63,12, 0.34,4, 0.11
98039,3247,730, 224.82,31, 9.55,2, 0.62,0, 0.00
98040,24470,5861, 239.52,163, 6.66,16, 0.65,5, 0.20
98042,48838,6422, 131.50,420, 8.60,38, 0.78,5, 0.10
98045,15333,2595, 169.24,55, 3.59,2, 0.13,1, 0.07
98047,6704,851, 126.94,105, 15.66,13, 1.94,2, 0.30
98051,3735,517, 138.42,25, 6.69,2, 0.54,1, 0.27
98052,69882,8974, 128.42,345, 4.94,72, 1.03,49, 0.70
98053,22484,2504, 111.37,63, 2.80,12, 0.53,6, 0.27
98055,24945,3684, 147.68,213, 8.54,32, 1.28,15, 0.60
98056,36346,5378, 147.97,334, 9.19,36, 0.99,7, 0.19
98057,13268,2855, 215.18,199, 15.00,21, 1.58,9, 0.68
98058,44805,6486, 144.76,363, 8.10,44, 0.98,13, 0.29
98059,39897,5409, 135.57,232, 5.81,27, 0.68,5, 0.13
98065,15789,2466, 156.18,81, 5.13,2, 0.13,0, 0.00
98070,10788,1794, 166.30,14, 1.30,1, 0.09,0, 0.00
98072,24584,3115, 126.71,116, 4.72,18, 0.73,4, 0.16
98074,28881,3568, 123.54,75, 2.60,3, 0.10,4, 0.14
98075,24330,3366, 138.35,126, 5.18,8, 0.33,4, 0.16
98077,14416,1719, 119.24,45, 3.12,4, 0.28,2, 0.14
98092,47868,5553, 116.01,466, 9.74,59, 1.23,9, 0.19
98101,16247,4793, 295.01,141, 8.68,21, 1.29,9, 0.55
98102,26690,8073, 302.47,133, 4.98,8, 0.30,1, 0.04
98103,53528,15186, 283.70,247, 4.61,27, 0.50,16, 0.30
98104,18339,5144, 280.50,253, 13.80,43, 2.34,11, 0.60
98105,54923,11452, 208.51,316, 5.75,12, 0.22,1, 0.02
98106,25898,5464, 210.98,294, 11.35,35, 1.35,4, 0.15
98107,29219,7717, 264.11,111, 3.80,8, 0.27,4, 0.14
98108,25264,5518, 218.41,301, 11.91,27, 1.07,7, 0.28
98109,34939,7818, 223.76,226, 6.47,39, 1.12,19, 0.54
98112,24026,7792, 324.32,114, 4.74,13, 0.54,3, 0.12
98115,53109,13558, 255.29,245, 4.61,24, 0.45,9, 0.17
98116,26979,6469, 239.78,139, 5.15,8, 0.30,2, 0.07
98117,34314,9956, 290.14,176, 5.13,25, 0.73,7, 0.20
98118,49108,11377, 231.67,595, 12.12,62, 1.26,11, 0.22
98119,26126,5935, 227.17,86, 3.29,6, 0.23,1, 0.04
98121,22274,3890, 174.64,73, 3.28,4, 0.18,2, 0.09
98122,44306,12558, 283.44,241, 5.44,17, 0.38,6, 0.14
98125,43312,9000, 207.79,282, 6.51,36, 0.83,9, 0.21
98126,24341,5647, 232.00,159, 6.53,30, 1.23,14, 0.58
98133,49594,10272, 207.12,439, 8.85,64, 1.29,30, 0.60
98134,675,414, 613.33,17, 25.19,3, 4.44,0, 0.00
98136,16216,4165, 256.85,78, 4.81,6, 0.37,3, 0.19
98144,32523,9509, 292.38,358, 11.01,58, 1.78,20, 0.61
98146,29292,5057, 172.64,352, 12.02,41, 1.40,12, 0.41
98148,10823,1677, 154.95,131, 12.10,18, 1.66,3, 0.28
98155,34534,6970, 201.83,286, 8.28,47, 1.36,24, 0.69
98164,157,3972, 25299.36,9, 57.32,0, 0.00,1, 6.37
98166,21840,3947, 180.72,196, 8.97,27, 1.24,4, 0.18
98168,36076,6291, 174.38,644, 17.85,49, 1.36,7, 0.19
98177,20330,4526, 222.63,143, 7.03,31, 1.52,21, 1.03
98178,26649,4931, 185.04,308, 11.56,28, 1.05,7, 0.26
98188,25097,5094, 202.97,428, 17.05,41, 1.63,7, 0.28
98195,0,40, .,4, .,0, .,0, .
98198,36960,6225, 168.43,523, 14.15,49, 1.33,6, 0.16
98199,21488,4913, 228.64,61, 2.84,3, 0.14,1, 0.05
98224,310,16, 51.61,1, 3.23,0, 0.00,0, 0.00
98288,374,46, 122.99,0, 0.00,0, 0.00,0, 0.00
98354,7419,65, 8.76,6, 0.81,1, 0.13,2, 0.27
98422,21107,7, 0.33,4, 0.19,2, 0.09,0, 0.00

+ 85
- 0
source_data/covid-19_20200831_zip.csv View File

@@ -0,0 +1,85 @@
Location_Name,Population,Tests,Test_Rate,Positives,Positive_Rate,Hospitalizations,Hospitalization_Rate,Deaths,Death_Rate
00000,2226300,361435, 16234.78,19665, 883.30,2229, 100.12,720, 32.34
98001,35948,4520, 125.74,460, 12.80,46, 1.28,8, 0.22
98002,35106,5255, 149.69,669, 19.06,69, 1.97,12, 0.34
98003,49587,7308, 147.38,1043, 21.03,100, 2.02,24, 0.48
98004,34755,5554, 159.80,235, 6.76,30, 0.86,9, 0.26
98005,20154,2432, 120.67,129, 6.40,17, 0.84,0, 0.00
98006,38904,4763, 122.43,155, 3.98,14, 0.36,4, 0.10
98007,28612,2748, 96.04,182, 6.36,27, 0.94,12, 0.42
98008,26113,3115, 119.29,224, 8.58,39, 1.49,16, 0.61
98010,5549,642, 115.70,33, 5.95,1, 0.18,1, 0.18
98011,34504,3565, 103.32,161, 4.67,27, 0.78,12, 0.35
98014,7630,890, 116.64,24, 3.15,5, 0.66,0, 0.00
98019,12209,1273, 104.27,41, 3.36,0, 0.00,1, 0.08
98022,22792,2447, 107.36,153, 6.71,32, 1.40,26, 1.14
98023,50842,6359, 125.07,612, 12.04,53, 1.04,7, 0.14
98024,6000,707, 117.83,20, 3.33,1, 0.17,0, 0.00
98027,30108,4348, 144.41,227, 7.54,44, 1.46,25, 0.83
98028,23193,3164, 136.42,143, 6.17,28, 1.21,9, 0.39
98029,29254,3840, 131.26,111, 3.79,12, 0.41,12, 0.41
98030,36849,4936, 133.95,668, 18.13,66, 1.79,24, 0.65
98031,39076,5606, 143.46,580, 14.84,57, 1.46,16, 0.41
98032,36699,5614, 152.97,680, 18.53,51, 1.39,11, 0.30
98033,38814,5620, 144.79,238, 6.13,26, 0.67,7, 0.18
98034,44252,5933, 134.07,420, 9.49,103, 2.33,56, 1.27
98038,35227,4230, 120.08,179, 5.08,14, 0.40,4, 0.11
98039,3247,603, 185.71,32, 9.86,2, 0.62,0, 0.00
98040,24470,4975, 203.31,169, 6.91,16, 0.65,5, 0.20
98042,48838,5691, 116.53,441, 9.03,42, 0.86,6, 0.12
98045,15333,2224, 145.05,58, 3.78,2, 0.13,1, 0.07
98047,6704,787, 117.39,108, 16.11,13, 1.94,2, 0.30
98051,3735,445, 119.14,29, 7.76,2, 0.54,1, 0.27
98052,69882,7834, 112.10,351, 5.02,73, 1.04,49, 0.70
98053,22484,2143, 95.31,64, 2.85,11, 0.49,6, 0.27
98055,24945,3268, 131.01,232, 9.30,36, 1.44,15, 0.60
98056,36346,4790, 131.79,346, 9.52,34, 0.94,7, 0.19
98057,13268,2501, 188.50,200, 15.07,18, 1.36,10, 0.75
98058,44805,5698, 127.17,378, 8.44,43, 0.96,12, 0.27
98059,39897,4834, 121.16,249, 6.24,28, 0.70,5, 0.13
98065,15789,2151, 136.23,85, 5.38,2, 0.13,0, 0.00
98070,10788,1601, 148.41,14, 1.30,1, 0.09,0, 0.00
98072,24584,2678, 108.93,125, 5.08,21, 0.85,5, 0.20
98074,28881,3130, 108.38,77, 2.67,3, 0.10,4, 0.14
98075,24330,2909, 119.56,130, 5.34,8, 0.33,4, 0.16
98077,14416,1487, 103.15,52, 3.61,3, 0.21,1, 0.07
98092,47868,4920, 102.78,493, 10.30,61, 1.27,8, 0.17
98101,16247,3758, 231.30,159, 9.79,26, 1.60,10, 0.62
98102,26690,6381, 239.08,139, 5.21,7, 0.26,1, 0.04
98103,53528,12339, 230.51,253, 4.73,27, 0.50,15, 0.28
98104,18339,4123, 224.82,260, 14.18,42, 2.29,10, 0.55
98105,54923,8786, 159.97,323, 5.88,12, 0.22,1, 0.02
98106,25898,4705, 181.67,302, 11.66,37, 1.43,4, 0.15
98107,29219,6353, 217.43,115, 3.94,10, 0.34,5, 0.17
98108,25264,4725, 187.03,324, 12.82,27, 1.07,8, 0.32
98109,34939,6640, 190.05,235, 6.73,38, 1.09,20, 0.57
98112,24026,6258, 260.47,113, 4.70,12, 0.50,2, 0.08
98115,53109,11395, 214.56,247, 4.65,22, 0.41,9, 0.17
98116,26979,5445, 201.82,143, 5.30,8, 0.30,3, 0.11
98117,34314,7835, 228.33,175, 5.10,24, 0.70,7, 0.20
98118,49108,9626, 196.02,614, 12.50,65, 1.32,11, 0.22
98119,26126,5032, 192.61,87, 3.33,6, 0.23,1, 0.04
98121,22274,3300, 148.15,75, 3.37,4, 0.18,2, 0.09
98122,44306,9942, 224.39,252, 5.69,16, 0.36,6, 0.14
98125,43312,7696, 177.69,289, 6.67,37, 0.85,8, 0.18
98126,24341,4694, 192.84,163, 6.70,29, 1.19,14, 0.58
98133,49594,8793, 177.30,446, 8.99,62, 1.25,33, 0.67
98134,675,291, 431.11,13, 19.26,3, 4.44,0, 0.00
98136,16216,3389, 208.99,84, 5.18,7, 0.43,3, 0.19
98144,32523,7710, 237.06,371, 11.41,59, 1.81,19, 0.58
98146,29292,4525, 154.48,417, 14.24,44, 1.50,12, 0.41
98148,10823,1493, 137.95,134, 12.38,19, 1.76,3, 0.28
98155,34534,6038, 174.84,299, 8.66,48, 1.39,25, 0.72
98164,157,3169, 20184.71,0, 0.00,0, 0.00,0, 0.00
98166,21840,3430, 157.05,203, 9.29,27, 1.24,4, 0.18
98168,36076,5565, 154.26,655, 18.16,49, 1.36,7, 0.19
98177,20330,3916, 192.62,145, 7.13,30, 1.48,22, 1.08
98178,26649,4280, 160.61,325, 12.20,28, 1.05,7, 0.26
98188,25097,3887, 154.88,460, 18.33,43, 1.71,7, 0.28
98195,0,38, .,4, .,0, .,0, .
98198,36960,5321, 143.97,550, 14.88,50, 1.35,6, 0.16
98199,21488,4230, 196.85,64, 2.98,3, 0.14,1, 0.05
98224,310,14, 45.16,1, 3.23,0, 0.00,0, 0.00
98288,374,34, 90.91,0, 0.00,0, 0.00,0, 0.00
98354,7419,59, 7.95,5, 0.67,1, 0.13,2, 0.27
98422,21107,6, 0.28,3, 0.14,1, 0.05,0, 0.00

Loading…
Cancel
Save