Last active
March 16, 2020 02:29
Revisions
-
kamermans renamed this gist
Mar 16, 2020 . 1 changed file with 71 additions and 66 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ # COVID-19 by US County Arizona (13): Maricopa: 2 Pinal: 2 [unknown]: 9 California (426): Alameda: 2 Contra Costa: 9 Fresno: 1 @@ -23,20 +23,20 @@ California (221): Shasta: 1 Sonoma: 3 Yolo: 1 [unknown]: 325 Colorado (131): Denver: 2 Douglas: 3 El Paso: 1 Summit: 1 [unknown]: 124 District of Columbia (16): District of Columbia: 2 [unknown]: 14 Florida (115): Broward: 3 Charlotte: 1 Hillsborough: 2 @@ -45,158 +45,163 @@ Florida (35): Okaloosa: 1 Santa Rosa: 1 Volusia: 1 [unknown]: 102 Georgia (99): Cherokee: 1 Cobb: 3 Fulton: 5 Polk: 1 [unknown]: 89 Hawaii (6): Honolulu: 1 [unknown]: 5 Illinois (93): Cook: 7 [unknown]: 86 Indiana (20): Hendricks: 2 Marion: 1 [unknown]: 17 Iowa (18): Johnson: 3 [unknown]: 15 Kansas (8): Johnson: 1 [unknown]: 7 Kentucky (20): Fayette: 1 Harrison: 2 Jefferson: 1 [unknown]: 16 Louisiana (91): Jefferson: 1 [unknown]: 90 Maryland (32): Harford: 1 Montgomery: 4 [unknown]: 27 Massachusetts (164): Berkshire: 1 Middlesex: 7 Norfolk: 6 Suffolk: 8 [unknown]: 142 Minnesota (35): Carver: 1 Ramsey: 1 [unknown]: 33 Missouri (5): St. Louis: 1 [unknown]: 4 Nebraska (17): Douglas: 3 [unknown]: 14 Nevada (24): Clark: 2 Washoe: 2 [unknown]: 20 New Hampshire (13): Grafton: 3 Rockingham: 1 [unknown]: 9 New Jersey (98): Bergen: 4 Hudson: 1 [unknown]: 93 New York (732): Nassau: 17 New York: 19 Rockland: 4 Saratoga: 2 Suffolk: 1 Ulster: 1 Westchester: 98 [unknown]: 590 North Carolina (33): Chatham: 1 Wake: 1 [unknown]: 31 Oklahoma (7): Tulsa: 1 [unknown]: 6 Oregon (36): Douglas: 1 Jackson: 2 Klamath: 1 Marion: 1 Umatilla: 1 Washington: 8 [unknown]: 22 Pennsylvania (66): Delaware: 1 Montgomery: 5 Wayne: 1 [unknown]: 59 Rhode Island (20): Providence: 3 [unknown]: 17 South Carolina (28): Charleston: 1 Kershaw: 1 Spartanburg: 1 [unknown]: 25 Tennessee (39): Davidson: 1 Shelby: 1 Williamson: 1 [unknown]: 36 Texas (72): Collin: 1 Fort Bend: 6 Harris: 6 [unknown]: 59 United States Virgin Islands (1): St. Thomas: 1 Utah (28): Davis: 1 [unknown]: 27 Vermont (8): Bennington: 1 [unknown]: 7 Virginia (45): Fairfax: 2 [unknown]: 43 Washington (643): Clark: 1 Grant: 1 Jefferson: 1 King: 83 Kittitas: 1 Pierce: 4 Snohomish: 31 [unknown]: 521 -
kamermans revised this gist
Mar 13, 2020 . 2 changed files with 157 additions and 202 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,271 +1,202 @@ # COVID-19 by US County Arizona (9): Maricopa: 2 Pinal: 2 [unknown]: 5 California (221): Alameda: 2 Contra Costa: 9 Fresno: 1 Humboldt: 1 Los Angeles: 14 Madera: 1 Orange: 4 Placer: 7 Riverside: 1 Sacramento: 2 San Benito: 2 San Diego: 3 San Francisco: 9 San Mateo: 2 Santa Clara: 38 Shasta: 1 Sonoma: 3 Yolo: 1 [unknown]: 120 Colorado (45): Denver: 2 Douglas: 3 El Paso: 1 Summit: 1 [unknown]: 38 District of Columbia (10): District of Columbia: 2 [unknown]: 8 Florida (35): Broward: 3 Charlotte: 1 Hillsborough: 2 Lee: 2 Manatee: 2 Okaloosa: 1 Santa Rosa: 1 Volusia: 1 [unknown]: 22 Georgia (31): Cherokee: 1 Cobb: 3 Fulton: 5 Polk: 1 [unknown]: 21 Hawaii (2): Honolulu: 1 [unknown]: 1 Illinois (32): Cook: 7 [unknown]: 25 Indiana (13): Hendricks: 2 Marion: 1 [unknown]: 10 Iowa (16): Johnson: 3 [unknown]: 13 Kansas (1): Johnson: 1 Kentucky (10): Fayette: 1 Harrison: 2 Jefferson: 1 [unknown]: 6 Louisiana (19): Jefferson: 1 [unknown]: 18 Maryland (12): Harford: 1 Montgomery: 4 [unknown]: 7 Massachusetts (108): Berkshire: 1 Middlesex: 7 Norfolk: 6 Suffolk: 8 [unknown]: 86 Minnesota (9): Carver: 1 Ramsey: 1 [unknown]: 7 Missouri (1): St. Louis: 1 Nebraska (10): Douglas: 3 [unknown]: 7 Nevada (14): Clark: 2 Washoe: 2 [unknown]: 10 New Hampshire (6): Grafton: 3 Rockingham: 1 [unknown]: 2 New Jersey (29): Bergen: 4 Hudson: 1 [unknown]: 24 New York (328): Nassau: 17 New York: 19 Rockland: 4 Saratoga: 2 Suffolk: 1 Ulster: 1 Westchester: 98 [unknown]: 186 North Carolina (15): Chatham: 1 Wake: 1 [unknown]: 13 Oklahoma (2): Tulsa: 1 [unknown]: 1 Oregon (24): Douglas: 1 Jackson: 2 Klamath: 1 Marion: 1 Umatilla: 1 Washington: 8 [unknown]: 10 Pennsylvania (22): Delaware: 1 Montgomery: 5 Wayne: 1 [unknown]: 15 Rhode Island (5): Providence: 3 [unknown]: 2 South Carolina (12): Charleston: 1 Kershaw: 1 Spartanburg: 1 [unknown]: 9 Tennessee (18): Davidson: 1 Shelby: 1 Williamson: 1 [unknown]: 15 Texas (27): Collin: 1 Fort Bend: 6 Harris: 6 [unknown]: 14 Utah (5): Davis: 1 [unknown]: 4 Vermont (2): Bennington: 1 [unknown]: 1 Virginia (17): Fairfax: 2 [unknown]: 15 Washington (442): Clark: 1 Grant: 1 Jefferson: 1 King: 83 Kittitas: 1 Pierce: 4 Snohomish: 31 [unknown]: 320 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -74,6 +74,7 @@ func main() { perStateCounty := map[string]map[string]int{} perState := map[string]int{} perStateOther := map[string]int{} line := 0 for { @@ -97,6 +98,13 @@ func main() { } if !strings.Contains(record[colState], ",") { state := record[colState] v := lastValue(record) if _, ok := perStateOther[state]; !ok { perStateOther[state] = 0 } perStateOther[state] += v continue } @@ -128,20 +136,9 @@ func main() { } // Iterate the record in reverse to find the most recent count v := lastValue(record) perState[geo.State.Name] += v perStateCounty[geo.State.Name][geo.County.Name] += v } // fmt.Println("# COVID-19 by US State") @@ -177,11 +174,38 @@ func main() { fmt.Println("# COVID-19 by US County") for _, state := range statesLookup { noCountySum := 0 if v, ok := perStateOther[state]; ok { noCountySum = v - perState[state] } fmt.Printf("%s (%v):\n", state, perState[state]+noCountySum) for _, county := range countiesLookup[state] { fmt.Printf(" %s: %v\n", county, perStateCounty[state][county]) } if noCountySum > 0 { fmt.Printf(" [unknown]: %v\n", noCountySum) } fmt.Println("") } } func lastValue(record []string) int { for i := len(record) - 1; i > firstDataColumn; i-- { v, err := strconv.Atoi(record[i]) if err != nil { continue } if v == 0 { continue } return v } return 0 } -
kamermans renamed this gist
Mar 12, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
kamermans revised this gist
Mar 12, 2020 . 1 changed file with 146 additions and 89 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,214 +1,271 @@ # COVID-19 by US County Arizona (9): Maricopa: 3 Pima: 1 Pinal: 5 California (175): Alameda: 5 Calaveras: 2 Contra Costa: 10 Fresno: 3 Humboldt: 1 Los Angeles: 27 Madera: 1 Marin: 1 Napa: 1 Orange: 5 Placer: 7 Riverside: 6 Sacramento: 11 San Benito: 2 San Diego: 3 San Francisco: 14 San Mateo: 15 Santa Clara: 48 Santa Cruz: 2 Shasta: 1 Solano: 3 Sonoma: 3 Stanislaus: 2 Ventura: 1 Yolo: 1 Colorado (27): Arapahoe: 3 Denver: 6 Douglas: 3 Eagle: 4 El Paso: 1 Gunnison: 5 Jefferson: 3 Larimer: 1 Summit: 1 Connecticut (3): Fairfield: 2 Litchfield: 1 Delaware (1): New Castle: 1 District of Columbia (4): District of Columbia: 4 Florida (24): Alachua: 1 Broward: 4 Charlotte: 1 Collier: 3 Hillsborough: 3 Lee: 2 Manatee: 2 Nassau: 1 Okaloosa: 1 Pasco: 1 Pinellas: 2 Santa Rosa: 1 Volusia: 2 Georgia (22): Charlton: 1 Cherokee: 1 Cobb: 7 DeKalb: 2 Fayette: 1 Fulton: 7 Gwinnett: 2 Polk: 1 Hawaii (2): Honolulu: 2 Illinois (25): Cook: 22 Kane: 1 Lake: 1 McHenry: 1 Indiana (10): Boone: 1 Hendricks: 2 Howard: 1 Johnson: 3 Marion: 1 Noble: 1 St. Joseph: 1 Iowa (13): Johnson: 12 Pottawattamie: 1 Kansas (1): Johnson: 1 Kentucky (9): Fayette: 2 Floyd: 1 Harrison: 5 Jefferson: 1 Louisiana (6): Jefferson: 1 Orleans: 5 Maryland (9): Harford: 1 Montgomery: 5 Prince George's: 3 Massachusetts (92): Berkshire: 7 Essex: 1 Middlesex: 41 Norfolk: 22 Suffolk: 20 Worcester: 1 Michigan (2): Oakland: 1 Wayne: 1 Minnesota (5): Anoka: 1 Carver: 1 Olmsted: 1 Ramsey: 2 Missouri (1): St. Louis: 1 Nebraska (5): Douglas: 4 Knox: 1 Nevada (7): Clark: 5 Washoe: 2 New Hampshire (5): Grafton: 3 Rockingham: 2 New Jersey (23): Bergen: 11 Burlington: 2 Camden: 1 Hudson: 1 Middlesex: 2 Monmouth: 4 Passaic: 1 Union: 1 New Mexico (3): Bernalillo: 1 Socorro: 2 New York (220): Nassau: 28 New York: 55 Rockland: 6 Saratoga: 2 Suffolk: 6 Ulster: 2 Westchester: 121 North Carolina (7): Chatham: 1 Wake: 6 Ohio (4): Cuyahoga: 3 Stark: 1 Oklahoma (2): Tulsa: 2 Oregon (19): Deschutes: 1 Douglas: 1 Jackson: 2 Klamath: 1 Marion: 2 Multnomah: 1 Polk: 1 Umatilla: 2 Washington: 8 Pennsylvania (16): Adams: 1 Bucks: 1 Delaware: 1 Monroe: 2 Montgomery: 9 Philadelphia: 1 Wayne: 1 Rhode Island (5): Providence: 5 South Carolina (10): Charleston: 1 Kershaw: 7 Lancaster: 1 Spartanburg: 1 South Dakota (8): Beadle: 1 Bon Homme: 1 Charles Mix: 1 Davison: 1 Minnehaha: 3 Pennington: 1 Tennessee (9): Davidson: 2 Shelby: 1 Sullivan: 1 Williamson: 5 Texas (21): Collin: 3 Dallas: 2 Fort Bend: 6 Gregg: 1 Harris: 7 Montgomery: 1 Tarrant: 1 Utah (3): Davis: 1 Summit: 1 Weber: 1 Vermont (1): Bennington: 1 Virginia (9): Arlington: 1 Fairfax: 3 Hanover: 1 Loudoun: 1 Norfolk City: 2 Spotsylvania: 1 Washington (282): Clark: 1 Grant: 1 Island: 1 Jefferson: 1 King: 190 Kitsap: 2 Kittitas: 1 Pierce: 14 Skagit: 1 Snohomish: 68 Thurston: 1 Whatcom: 1 Wisconsin (4): Dane: 2 Pierce: 2 -
kamermans revised this gist
Mar 11, 2020 . 2 changed files with 96 additions and 91 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,135 +1,139 @@ # COVID-19 by US County Arizona (6): Maricopa: 2 Pima: 1 Pinal: 3 California (145): Alameda: 3 Contra Costa: 9 Fresno: 1 Humboldt: 1 Los Angeles: 20 Madera: 1 Napa: 1 Orange: 5 Placer: 7 Riverside: 4 Sacramento: 10 San Benito: 2 San Diego: 3 San Francisco: 15 San Mateo: 9 Santa Clara: 43 Santa Cruz: 2 Shasta: 1 Solano: 3 Sonoma: 3 Ventura: 1 Yolo: 1 Colorado (15): Arapahoe: 2 Denver: 3 Douglas: 3 Eagle: 2 El Paso: 1 Gunnison: 1 Larimer: 2 Summit: 1 Connecticut (1): Fairfield: 1 District of Columbia (5): District of Columbia: 5 Florida (16): Broward: 5 Charlotte: 1 Hillsborough: 2 Lee: 2 Manatee: 2 Okaloosa: 1 Santa Rosa: 1 Volusia: 2 Georgia (16): Cherokee: 1 Cobb: 4 DeKalb: 2 Fayette: 1 Fulton: 5 Gwinnett: 2 Polk: 1 Hawaii (1): Honolulu: 1 Illinois (12): Cook: 11 Kane: 1 Indiana (5): Boone: 1 Hendricks: 2 Marion: 1 Noble: 1 Iowa (8): Johnson: 7 Pottawattamie: 1 Kansas (1): Johnson: 1 Kentucky (6): Fayette: 2 Floyd: 1 Harrison: 2 Jefferson: 1 Louisiana (1): Jefferson: 1 Maryland (8): Harford: 1 Montgomery: 4 Prince George's: 3 Massachusetts (41): Berkshire: 5 Middlesex: 15 Norfolk: 10 Suffolk: 10 Worcester: 1 Minnesota (2): Carver: 1 Ramsey: 1 Missouri (1): St. Louis: 1 Nebraska (3): Douglas: 3 Nevada (4): Clark: 2 Washoe: 2 New Hampshire (4): Grafton: 3 Rockingham: 1 New Jersey (15): Bergen: 7 Burlington: 2 Camden: 1 Hudson: 1 Monmouth: 2 Passaic: 1 Union: 1 New York (150): Nassau: 19 New York: 25 Rockland: 4 Saratoga: 2 Suffolk: 1 @@ -138,77 +142,73 @@ New York (173): North Carolina (7): Chatham: 1 Wake: 6 Ohio (3): Cuyahoga: 3 Oklahoma (2): Tulsa: 2 Oregon (14): Douglas: 1 Jackson: 2 Klamath: 1 Marion: 1 Umatilla: 1 Washington: 8 Pennsylvania (13): Adams: 1 Delaware: 1 Monroe: 1 Montgomery: 8 Philadelphia: 1 Wayne: 1 Rhode Island (3): Providence: 3 South Carolina (7): Charleston: 1 Kershaw: 5 Spartanburg: 1 Tennessee (3): Davidson: 1 Shelby: 1 Williamson: 1 Texas (16): Collin: 3 Fort Bend: 6 Gregg: 1 Harris: 6 Utah (2): Davis: 1 Weber: 1 Vermont (1): Bennington: 1 Virginia (9): Arlington: 1 Fairfax: 4 Loudoun: 1 Norfolk City: 2 Spotsylvania: 1 Washington (162): Clark: 1 Grant: 1 Jefferson: 1 King: 116 Kitsap: 1 Kittitas: 1 Pierce: 4 Snohomish: 37 Wisconsin (3): Dane: 2 Pierce: 1 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import ( "net/http" "sort" "strconv" "strings" ) const ( @@ -95,6 +96,10 @@ func main() { continue } if !strings.Contains(record[colState], ",") { continue } lat, err := strconv.ParseFloat(record[colLat], 64) if err != nil { panic(err) @@ -133,8 +138,8 @@ func main() { break } perState[geo.State.Name] += v perStateCounty[geo.State.Name][geo.County.Name] += v break } } -
kamermans renamed this gist
Mar 11, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
kamermans revised this gist
Mar 11, 2020 . 2 changed files with 240 additions and 172 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,183 +1,214 @@ # COVID-19 by US County Arizona (6): Maricopa: 6 Pinal: 2 California (144): Alameda: 2 Contra Costa: 12 Fresno: 1 Humboldt: 1 Kings: 144 Los Angeles: 14 Madera: 1 Orange: 4 Placer: 7 Riverside: 1 Sacramento: 2 San Benito: 2 San Diego: 3 San Francisco: 9 San Mateo: 2 Santa Clara: 38 Shasta: 1 Sonoma: 3 Yolo: 1 Colorado (15): Denver: 2 Douglas: 3 El Paso: 1 Summit: 2 Teller: 15 Connecticut (2): Fairfield: 1 Hartford: 2 District of Columbia (5): District of Columbia: 5 Florida (15): Broward: 3 Charlotte: 1 Hillsborough: 2 Lee: 2 Manatee: 2 Okaloosa: 1 Polk: 15 Santa Rosa: 1 Sarasota: 1 Volusia: 1 Georgia (17): Cherokee: 1 Cobb: 3 Fulton: 5 Jones: 17 Polk: 1 Hawaii (2): Honolulu: 2 Illinois (12): Cook: 7 McLean: 12 Indiana (6): Hendricks: 2 Marion: 6 Iowa (8): Johnson: 3 Marshall: 8 Kansas (1): Johnson: 1 Morris: 1 Kentucky (6): Fayette: 1 Garrard: 6 Harrison: 2 Jefferson: 1 Louisiana (1): Avoyelles: 1 Jefferson: 1 Maryland (8): Anne Arundel: 8 Harford: 1 Montgomery: 4 Massachusetts (92): Berkshire: 1 Middlesex: 92 Norfolk: 6 Plymouth: 1 Suffolk: 8 Minnesota (3): Benton: 3 Carver: 1 Ramsey: 1 Missouri (1): Cole: 1 St. Louis: 1 Nebraska (3): Douglas: 3 Merrick: 3 Nevada (4): Clark: 2 Nye: 4 Washoe: 2 New Hampshire (4): Belknap: 4 Grafton: 4 Rockingham: 1 New Jersey (15): Bergen: 4 Hudson: 1 Middlesex: 15 New York (173): Delaware: 173 Nassau: 17 New York: 19 Rockland: 4 Saratoga: 2 Suffolk: 1 Ulster: 1 Westchester: 98 North Carolina (7): Chatham: 1 Randolph: 7 Wake: 1 Ohio (3): Morrow: 3 Oklahoma (2): Lincoln: 2 Tulsa: 1 Oregon (15): Douglas: 1 Jackson: 2 Klamath: 1 Linn: 15 Marion: 1 Umatilla: 1 Washington: 8 Pennsylvania (12): Delaware: 1 Juniata: 12 Montgomery: 5 Wayne: 1 Rhode Island (3): Kent: 3 Providence: 3 South Carolina (7): Charleston: 1 Kershaw: 4 Richland: 7 Spartanburg: 1 Tennessee (7): Davidson: 1 Rutherford: 7 Shelby: 1 Williamson: 1 Texas (13): Bell: 13 Bexar: 1 Collin: 1 Fort Bend: 6 Harris: 6 Utah (2): Davis: 1 Utah: 2 Vermont (1): Bennington: 1 Washington: 1 Virginia (7): Fairfax: 2 Fluvanna: 7 Washington (267): Chelan: 5 Clark: 1 Grant: 1 Jefferson: 1 King: 267 Kittitas: 1 Pierce: 4 Snohomish: 31 Spokane: 1 Wisconsin (3): Dane: 1 Portage: 3 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import ( "io/ioutil" "log" "net/http" "sort" "strconv" ) @@ -121,23 +122,59 @@ func main() { perStateCounty[geo.State.Name][geo.County.Name] = 0 } // Iterate the record in reverse to find the most recent count for i := len(record) - 1; i > firstDataColumn; i-- { v, err := strconv.Atoi(record[i]) if err != nil { continue } if v == 0 { break } perState[geo.State.Name] = v perStateCounty[geo.State.Name][geo.County.Name] = v break } } // fmt.Println("# COVID-19 by US State") // for state, v := range perState { // fmt.Printf("%s: %v\n", state, v) // } // fmt.Println("") statesLookup := []string{} countiesLookup := map[string][]string{} for state, perCounty := range perStateCounty { if perState[state] == 0 { continue } statesLookup = append(statesLookup, state) counties := []string{} for county, v := range perCounty { if v == 0 { continue } counties = append(counties, county) } sort.Strings(counties) countiesLookup[state] = counties } sort.Strings(statesLookup) fmt.Println("# COVID-19 by US County") for _, state := range statesLookup { fmt.Printf("%s (%v):\n", state, perState[state]) for _, county := range countiesLookup[state] { fmt.Printf(" %s: %v\n", county, perStateCounty[state][county]) } fmt.Println("") } -
kamermans revised this gist
Mar 10, 2020 . 2 changed files with 183 additions and 169 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,169 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,183 @@ # COVID-19 by US County Missouri (2): St. Louis: 2 Vermont (2): Bennington: 2 Illinois (112): Cook: 112 Arizona (57): Maricopa: 51 Pinal: 6 Nevada (13): Clark: 7 Washoe: 6 Indiana (7): Marion: 4 Hendricks: 3 Rhode Island (20): Providence: 20 District of Columbia (4): District of Columbia: 4 Washington (656): Grant: 5 Chelan: 20 Pierce: 9 King: 465 Snohomish: 147 Kittitas: 2 Spokane: 2 Clark: 3 Jefferson: 3 California (740): San Benito: 72 Orange: 57 Santa Clara: 240 Shasta: 1 San Diego: 59 Humboldt: 18 San Mateo: 15 Contra Costa: 32 Riverside: 2 Solano: 15 Sonoma: 10 San Francisco: 31 Alameda: 10 Fresno: 2 Los Angeles: 111 Sacramento: 30 Placer: 28 Yolo: 4 Madera: 3 Louisiana (1): Jefferson: 1 Maryland (16): Montgomery: 14 Harford: 2 Kentucky (7): Fayette: 4 Harrison: 2 Jefferson: 1 Wisconsin (34): Dane: 34 Texas (71): Collin: 1 Bexar: 32 Harris: 21 Fort Bend: 17 Montgomery: 0 Georgia (30): Fulton: 19 Cobb: 5 Polk: 5 Cherokee: 1 Tennessee (9): Williamson: 5 Davidson: 2 Shelby: 2 South Carolina (10): Spartanburg: 1 Charleston: 3 Kershaw: 6 Iowa (3): Johnson: 3 Oklahoma (3): Tulsa: 3 Virginia (4): Fairfax: 4 New Hampshire (22): Grafton: 19 Rockingham: 3 Oregon (51): Klamath: 3 Douglas: 2 Marion: 2 Umatilla: 8 Washington: 31 Jackson: 5 North Carolina (11): Wake: 7 Chatham: 4 New Jersey (18): Bergen: 16 Hudson: 2 Minnesota (5): Ramsey: 4 Carver: 1 Utah (3): Davis: 3 New York (397): Ulster: 2 Westchester: 286 New York: 65 Nassau: 28 Rockland: 8 Saratoga: 6 Suffolk: 2 Pennsylvania (17): Wayne: 4 Montgomery: 9 Delaware: 4 Nebraska (39): Douglas: 39 Colorado (28): Denver: 8 Summit: 8 Douglas: 9 El Paso: 3 Connecticut (4): Fairfield: 4 Florida (49): Broward: 7 Manatee: 3 Okaloosa: 2 Volusia: 2 Charlotte: 1 Sarasota: 8 Santa Rosa: 5 Hillsborough: 15 Lee: 6 Massachusetts (99): Norfolk: 19 Suffolk: 56 Middlesex: 18 Plymouth: 4 Berkshire: 2 Hawaii (4): Honolulu: 4 Kansas (2): Johnson: 2 -
kamermans created this gist
Mar 9, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,169 @@ # COVID-19 by US County Colorado (20): El Paso: 2 Denver: 6 Summit: 6 Douglas: 6 Oregon (37): Washington: 23 Jackson: 3 Klamath: 2 Douglas: 1 Marion: 1 Umatilla: 7 Nevada (9): Clark: 5 Washoe: 4 New York (255): Ulster: 1 Westchester: 188 New York: 46 Nassau: 11 Rockland: 4 Saratoga: 4 Suffolk: 1 Pennsylvania (10): Delaware: 3 Wayne: 3 Montgomery: 4 Connecticut (3): Fairfield: 3 Hawaii (2): Honolulu: 2 Oklahoma (2): Tulsa: 2 Missouri (1): St. Louis: 1 Wisconsin (33): Dane: 33 Nebraska (36): Douglas: 36 New Jersey (13): Bergen: 12 Hudson: 1 Kentucky (3): Fayette: 3 Virginia (2): Fairfax: 2 Kansas (1): Johnson: 1 Texas (57): Montgomery: 0 Bexar: 31 Harris: 15 Fort Bend: 11 Arizona (52): Maricopa: 48 Pinal: 4 Indiana (4): Marion: 3 Hendricks: 1 Minnesota (3): Ramsey: 3 Utah (2): Davis: 2 District of Columbia (2): District of Columbia: 2 Illinois (105): Cook: 105 New Hampshire (17): Grafton: 15 Rockingham: 2 Maryland (11): Montgomery: 10 Harford: 1 Rhode Island (17): Providence: 17 South Carolina (4): Charleston: 2 Kershaw: 2 Vermont (1): Washington: 1 Georgia (21): Cobb: 2 Polk: 5 Fulton: 14 Tennessee (6): Williamson: 4 Davidson: 1 Shelby: 1 Florida (35): Volusia: 1 Hillsborough: 13 Sarasota: 7 Santa Rosa: 4 Broward: 4 Lee: 4 Manatee: 1 Okaloosa: 1 North Carolina (9): Wake: 6 Chatham: 3 Massachusetts (75): Norfolk: 13 Suffolk: 48 Middlesex: 10 Plymouth: 3 Berkshire: 1 Washington (528): Spokane: 1 Snohomish: 116 Chelan: 15 Clark: 2 Jefferson: 2 Pierce: 5 King: 382 Grant: 4 Kittitas: 1 California (636): Los Angeles: 97 Sacramento: 28 San Francisco: 22 Fresno: 1 Solano: 15 Placer: 21 Sonoma: 7 Santa Clara: 202 San Diego: 56 Humboldt: 17 San Mateo: 13 Yolo: 3 Alameda: 8 Madera: 2 San Benito: 70 Orange: 53 Contra Costa: 20 Riverside: 1 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,145 @@ package main import ( "encoding/csv" "encoding/json" "fmt" "io" "io/ioutil" "log" "net/http" "strconv" ) const ( statsURL = "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Confirmed.csv" fccURL = "https://geo.fcc.gov/api/census/block/find?latitude=%v&longitude=%v&format=json" colState = 0 colCountry = 1 colLat = 2 colLon = 3 firstDataColumn = 4 ) type FCCData struct { County FCCCounty State FCCState Status string } type FCCCounty struct { Name string } type FCCState struct { Code string Name string } func LookupFCCData(lat, lon float64) *FCCData { resp, err := http.Get(fmt.Sprintf(fccURL, lat, lon)) if err != nil { panic(err) } defer resp.Body.Close() data, err := ioutil.ReadAll(resp.Body) if err != nil { panic(err) } out := new(FCCData) err = json.Unmarshal(data, out) if err != nil { panic(err) } return out } func main() { resp, err := http.Get(statsURL) if err != nil { panic(err) } defer resp.Body.Close() r := csv.NewReader(resp.Body) r.ReuseRecord = true perStateCounty := map[string]map[string]int{} perState := map[string]int{} line := 0 for { line++ record, err := r.Read() if err == io.EOF { break } if err != nil { log.Fatal(err) } if line == 1 { continue } if record[colCountry] != "US" { continue } lat, err := strconv.ParseFloat(record[colLat], 64) if err != nil { panic(err) } lon, err := strconv.ParseFloat(record[colLon], 64) if err != nil { panic(err) } geo := LookupFCCData(lat, lon) if geo.State.Name == "" { continue } if _, ok := perState[geo.State.Name]; !ok { perState[geo.State.Name] = 0 } if _, ok := perStateCounty[geo.State.Name]; !ok { perStateCounty[geo.State.Name] = map[string]int{} } if _, ok := perStateCounty[geo.State.Name][geo.County.Name]; !ok { perStateCounty[geo.State.Name][geo.County.Name] = 0 } for _, val := range record[firstDataColumn:] { v, err := strconv.Atoi(val) if err != nil { panic(err) } perState[geo.State.Name] += v perStateCounty[geo.State.Name][geo.County.Name] += v } } fmt.Println("# COVID-19 by US County") for state, perCounty := range perStateCounty { fmt.Printf("%s (%v):\n", state, perState[state]) for county, v := range perCounty { fmt.Printf(" %s: %v\n", county, v) } fmt.Println("") } }