Metadata-Version: 2.0
Name: pandas-redistrict
Version: 0.0.1
Summary: Redistricting of district-indexed tables
Home-page: https://github.com/correctiv/pandas-redistrict
Author: Stefan Wehrmeyer
Author-email: stefan.wehrmeyer@correctiv.org
License: MIT
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: Scientific/Engineering
Requires-Dist: pandas

# pandas-redistrict

Uses data on redistricting to apply redistricting to older datasets to represent the districts in their current state.

Supports merging and splitting of districts:
- Merged districts are summed up under new identifier
- Split districts are distributed by population-based ratio.

Data on redistricting is in `data/` directory. Currently only available for German *Kreise* (containing reforms in NRW, Sachsen, Sachsen-Anhalt and Mecklenburg-Vorpommern).


``` python
>>> df  # Values of indexed by German district identifiers
value1  value2
AGS
05354       4       5
05313       5       6
05334       6       7
15154       8       9
15159      10      11
15151      12      13
15082      13      14

>>> # Port old identifiers to new versions. Sum and distribute values on the way
>>> from redistrict import redistrict
>>> redistrict(df, 'de/kreise', drop=True, splits=True)
value1  value2
AGS
05334   15.00   18.00
15001    2.40    2.60
15082   35.44   38.81
15086    0.96    1.04
15091    4.20    4.55
```


