Skip to main content

Redistricting of district-indexed tables

Project description

# 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
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pandas-redistrict-0.0.1.tar.gz (39.7 kB view details)

Uploaded Source

Built Distribution

pandas_redistrict-0.0.1-py2.py3-none-any.whl (40.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pandas-redistrict-0.0.1.tar.gz.

File metadata

File hashes

Hashes for pandas-redistrict-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9c1252838ef38bfe76a65ef095db953e9228bb10d4f16689a90933bee49e8f75
MD5 b632ade9e9afc3ac0203c22601894ea2
BLAKE2b-256 fe36bbaff60f6c83eecec6311f1c3fb27c2e3142c8d2073f735908a0cf06b350

See more details on using hashes here.

File details

Details for the file pandas_redistrict-0.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pandas_redistrict-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d86a637fe764b6160e7a88e9405130fbcd6b663da6c0e341a3ddb16e1ac6fe20
MD5 990cf8bf823cb9a9e2ba3f7c99d133ed
BLAKE2b-256 00bf00d1532eb252085ec0fa6bdd28b25033a7a26fb0f59062e1f09c94c711c8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page