Skip to content

Instantly share code, notes, and snippets.

@mapmeld
Created January 8, 2020 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mapmeld/acdb0a46641f4017bfb9a066b1b1a4d1 to your computer and use it in GitHub Desktop.
Save mapmeld/acdb0a46641f4017bfb9a066b1b1a4d1 to your computer and use it in GitHub Desktop.
Count number of saved plans
# calculate number of plans, by state
import json
plans = open('districtr_full_export.json', 'r').read().strip().split("\n")
places = {}
for raw in plans:
plan = json.loads(raw)
if ("plan" in plan) and ("placeId" in plan["plan"]):
place = plan["plan"]["placeId"]
if place in places:
places[place] += 1
else:
places[place] = 1
print(places)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment