This file contains 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 characters
import csv | |
import json | |
import pprint | |
pp = pprint.PrettyPrinter(indent=4) | |
# setup: | |
# download the identifiers file for target country directly from the | |
# open civic identifiers public data repo: | |
# https://github.com/opencivicdata/ocd-division-ids/tree/master/identifiers | |
COUNTRY_SOURCE_FILE = 'country-us.csv' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 characters
election | country | state | original date | status | rescheduled date | |
---|---|---|---|---|---|---|
Clearwater City Council | US | FL | 2020-03-17 | held-as-planned | ||
Gainesville City Commission | US | FL | 2020-03-17 | held-as-planned | ||
Naples Mayor and City Council | US | FL | 2020-03-17 | held-as-planned | ||
Pembroke Pines City Commission | US | FL | 2020-03-17 | held-as-planned | ||
Pennsylvania House Special Election (D-8, 18 & 58) | US | PA | 2020-03-17 | held-as-planned | ||
Cambridge City Council (D-7) Special Election | CA | ON | 2020-03-23 | postponed | TBD | |
Massachusetts House Special Election | US | MA | 2020-03-31 | changed | 2020-06-02 | |
Massachusetts Senate Special Election | US | MA | 2020-03-31 | changed | 2020-05-19 | |
Columbia City Council | US | MO | 2020-04-07 | changed | 2020-06-02 |
This file contains 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 characters
City | Pop. | Status | |
---|---|---|---|
Los Angeles, CA | 3,976,322 | Already Districted | |
San Diego, CA | 1,394,928 | Already Districted | |
San Jose, CA | 1,026,908 | Already Districted | |
San Francisco, CA | 864,816 | Already Districted | |
Fresno, CA | 520,052 | Already Districted | |
Sacramento, CA | 490,712 | Already Districted | |
Long Beach, CA | 474,140 | Already Districted | |
Oakland, CA | 419,267 | Already Districted | |
Bakersfield, CA | 373,640 | Already Districted |
This file contains 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 characters
#jitter overlapping points, plot in an evenly spaced circle around the original center | |
import math | |
def geo_jitter(points_to_jitter): | |
for i in range(len(points_to_jitter)): | |
r = .01 | |
angle = 0 + ((360/len(points_to_jitter)) * i) |
This file contains 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 characters
AK,2,ALASKA | |
AL,1,ALABAMA | |
AR,5,ARKANSAS | |
AS,60,AMERICAN SAMOA | |
AZ,4,ARIZONA | |
CA,6,CALIFORNIA | |
CO,8,COLORADO | |
CT,9,CONNECTICUT | |
DC,11,DISTRICT OF COLUMBIA | |
DE,10,DELAWARE |
This file contains 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 characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
path { | |
stroke-width: 1px; | |
stroke: #444; | |
} | |
text { |