In [14]:
import os
import json

#os.chdir('../web/html/data')
nbrh = open('neighborhoods_geo.json').read()
bp = open('neighbors_bp.json').read()

In [18]:
nb= json.loads(nbrh)
props = [ f['properties'] for f in nb['features'] ]
props


Out[18]:
[{'name': 'Southeast Neighbors'},
 {'name': 'Amazon Neighbors Association'},
 {'name': 'West University Neighbors'},
 {'name': 'Southwest Hills Neighborhood Association'},
 {'name': 'OUT'},
 {'name': 'South University Neighborhood Association'},
 {'name': 'Friendly Area Neighbors'},
 {'name': 'Laurel Hill Valley Citizens'},
 {'name': 'Fairmount Neighbors'},
 {'name': 'Jefferson Westside Neighbors'},
 {'name': 'Far West Neighborhood Association'},
 {'name': 'Downtown Neighborhood Association'},
 {'name': 'Churchill Area Neighbors'},
 {'name': 'West Eugene Community Organization'},
 {'name': 'Whiteaker Community Council'},
 {'name': 'Trainsong Neighbors'},
 {'name': 'Harlow Neighbors'},
 {'name': 'River Road Community Organization'},
 {'name': 'Active Bethel Citizens'},
 {'name': 'Cal Young Neighborhood Association'},
 {'name': 'Industrial Corridor Community Organization'},
 {'name': 'Santa Clara Community Organization'},
 {'name': 'OUT'},
 {'name': 'Northeast Neighbors'},
 {'name': 'Goodpasture Island Neighbors'}]

In [16]:
bpo =json.loads(bp)
bpo


Out[16]:
{'neighbor_bps': [{'count': 12, 'neighborhood': 'Active Bethel Citizens'},
  {'count': 1, 'neighborhood': 'Amazon Neighbors Association'},
  {'count': 33, 'neighborhood': 'Cal Young Neighborhood Association'},
  {'count': 28, 'neighborhood': 'Churchill Area Neighbors'},
  {'count': 1, 'neighborhood': 'Downtown Neighborhood Association'},
  {'count': 1, 'neighborhood': 'Fairmount Neighbors'},
  {'count': 1, 'neighborhood': 'Far West Neighborhood Association'},
  {'count': 8, 'neighborhood': 'Friendly Area Neighbors'},
  {'count': 7, 'neighborhood': 'Harlow Neighbors'},
  {'count': 2, 'neighborhood': 'Jefferson Westside Neighbors'},
  {'count': 9, 'neighborhood': 'Laurel Hill Valley Citizens'},
  {'count': 88, 'neighborhood': 'Northeast Neighbors'},
  {'count': 33, 'neighborhood': 'River Road Community Organization'},
  {'count': 37, 'neighborhood': 'Santa Clara Community Organization'},
  {'count': 10, 'neighborhood': 'Southeast Neighbors'},
  {'count': 1, 'neighborhood': 'South University Neighborhood Association'},
  {'count': 5, 'neighborhood': 'Southwest Hills Neighborhood Association'},
  {'count': 8, 'neighborhood': 'Unknown'},
  {'count': 1, 'neighborhood': 'West Eugene Community Organization'},
  {'count': 1, 'neighborhood': 'West University Neighbors'}]}

In [22]:
for item in bpo['neighbor_bps']:
    p['name'] == (item['count']) for p in props if item['neighborhood']==p['name']]


  File "<ipython-input-22-92c24ceb3e49>", line 2
    [(p['name'], (item['count']) for p in props if p['name']==item['neighborhood']]
                                   ^
SyntaxError: invalid syntax