In [1]:
from mander import districts, metrics, utils
import pandas as pd
from matplotlib import pyplot as plt
%matplotlib inline
In [2]:
myDistrict = districts.District('test/data/CD_CA_24.geojson')
In [6]:
myDistrict.gdf.plot()
In [5]:
metrics.calculateReock(myDistrict)
In [2]:
fname = 'test/data/MN_Senate_2017.geojson'
In [3]:
myDistrict = districts.District(fname)
In [4]:
myDistrict.gdf.plot()
Out[4]:
In [5]:
reocks = metrics.calculateReock(myDistrict)
In [6]:
plt.hist(reocks)
Out[6]:
In [9]:
metrics.scoresToGeojson(myDistrict, 'polsbypopper', 'test/data/MN_Senate_2017_polsby.geojson')
In [10]:
metrics.scoresToGeojson(myDistrict, 'reock', 'test/data/MN_Senate_2017_reock.geojson')
In [ ]: