{ "info": { "author": "Stefan Wehrmeyer", "author_email": "stefan.wehrmeyer@correctiv.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Topic :: Scientific/Engineering" ], "description": "# pandas-redistrict\n\nUses data on redistricting to apply redistricting to older datasets to represent the districts in their current state.\n\nSupports merging and splitting of districts:\n- Merged districts are summed up under new identifier\n- Split districts are distributed by population-based ratio.\n\nData on redistricting is in `data/` directory. Currently only available for German *Kreise* (containing reforms in NRW, Sachsen, Sachsen-Anhalt and Mecklenburg-Vorpommern).\n\nInstall like this:\n\n pip install pandas-redistrict\n\n\n## Usage\n\n``` python\n>>> df # Values indexed by German district identifiers\nvalue1 value2\nAGS\n05354 4 5\n05313 5 6\n05334 6 7\n15154 8 9\n15159 10 11\n15151 12 13\n15082 13 14\n\n>>> # Port old identifiers to new versions. Sum and distribute values on the way\n>>> from redistrict import redistrict\n>>> redistrict(df, 'de/kreise', drop=True, splits=True)\nvalue1 value2\nAGS\n05334 15.00 18.00\n15001 2.40 2.60\n15082 35.44 38.81\n15086 0.96 1.04\n15091 4.20 4.55\n```\n\nWhen you want to preserve groups inside districts, you can use ``redistrict_grouped``:\n\n``` python\n>>> # Specify district column (e.g. AGS)\n>>> # Also specify groups to preserve, in this case year\n>>> df\n AGS year value1 value2\n0 05354 2008 4 5\n1 05313 2008 5 6\n2 05334 2011 6 7\n3 15154 2005 8 9\n4 15159 2005 10 11\n5 15151 2005 12 13\n6 15082 2013 13 14\n>>> from redistrict import redistrict_grouped\n redistrict_grouped(df, 'de/kreise', ['year'],\n district_col='AGS',\n value_cols=['value1', 'value2'],\n drop=True)\n\n AGS value1 value2 year\n0 15001 2.40 2.60 2005\n1 15082 22.44 24.81 2005\n2 15086 0.96 1.04 2005\n3 15091 4.20 4.55 2005\n0 05334 9.00 11.00 2008\n0 05334 6.00 7.00 2011\n0 15082 13.00 14.00 2013\n```", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/correctiv/pandas-redistrict", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pandas-redistrict", "package_url": "https://pypi.org/project/pandas-redistrict/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pandas-redistrict/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/correctiv/pandas-redistrict" }, "release_url": "https://pypi.org/project/pandas-redistrict/0.0.3/", "requires_dist": null, "requires_python": null, "summary": "Redistricting of pandas dataframes", "version": "0.0.3" }, "last_serial": 1712944, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "990cf8bf823cb9a9e2ba3f7c99d133ed", "sha256": "d86a637fe764b6160e7a88e9405130fbcd6b663da6c0e341a3ddb16e1ac6fe20" }, "downloads": -1, "filename": "pandas_redistrict-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "990cf8bf823cb9a9e2ba3f7c99d133ed", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 40812, "upload_time": "2015-07-13T13:33:17", "url": "https://files.pythonhosted.org/packages/00/bf/00d1532eb252085ec0fa6bdd28b25033a7a26fb0f59062e1f09c94c711c8/pandas_redistrict-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b632ade9e9afc3ac0203c22601894ea2", "sha256": "9c1252838ef38bfe76a65ef095db953e9228bb10d4f16689a90933bee49e8f75" }, "downloads": -1, "filename": "pandas-redistrict-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b632ade9e9afc3ac0203c22601894ea2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39687, "upload_time": "2015-07-13T13:27:11", "url": "https://files.pythonhosted.org/packages/fe/36/bbaff60f6c83eecec6311f1c3fb27c2e3142c8d2073f735908a0cf06b350/pandas-redistrict-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "built for Darwin-14.5.0", "digests": { "md5": "525a33510ade786e4c74a85976b357bf", "sha256": "f97b59a0d6705951b86ff587395eeb9b62a5e61e1ea4627b7a47431bc2713cd6" }, "downloads": -1, "filename": "pandas-redistrict-0.0.2.macosx-10.10-intel.tar.gz", "has_sig": false, "md5_digest": "525a33510ade786e4c74a85976b357bf", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 44724, "upload_time": "2015-08-27T15:37:37", "url": "https://files.pythonhosted.org/packages/f7/98/3b9341e1f953e6fc8d7196ab1f1c19e77060fb7919663262142942a74124/pandas-redistrict-0.0.2.macosx-10.10-intel.tar.gz" }, { "comment_text": "", "digests": { "md5": "587758fbbddd4588811c1c14f4222934", "sha256": "2c409bed08e327242165528ff690a24633ab5ab657663c4d98ec77da1e6325dd" }, "downloads": -1, "filename": "pandas_redistrict-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "587758fbbddd4588811c1c14f4222934", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 43160, "upload_time": "2015-08-27T15:36:58", "url": "https://files.pythonhosted.org/packages/cb/78/f7dd9651dfe8d5581d758fd15e20b9fc8b3eed9673962fa4b1cb910ecb43/pandas_redistrict-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f8672e7d48fa59292e706f0602d403cf", "sha256": "cd1fec48690f624e6c0e0cefa229b26a8b8657d41bbdbdc0e761bc84ca31ca7a" }, "downloads": -1, "filename": "pandas-redistrict-0.0.2.tar.gz", "has_sig": false, "md5_digest": "f8672e7d48fa59292e706f0602d403cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41912, "upload_time": "2015-08-27T15:37:22", "url": "https://files.pythonhosted.org/packages/b5/85/84a888843e0559be0e4b1fad831604303b4fa1b7bc60b2f2b0cb39edd18c/pandas-redistrict-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "ec8f3f5614a47d0e627943143ec5d869", "sha256": "5341ced47920ab6432228c3426022186c186f91983fbb5e397e5c3f2dee8029f" }, "downloads": -1, "filename": "pandas_redistrict-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ec8f3f5614a47d0e627943143ec5d869", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 43167, "upload_time": "2015-09-08T10:33:59", "url": "https://files.pythonhosted.org/packages/55/14/ee5b95358f8c5833331b8f7d8bf6133855b6c7b6f3118e58ea0f38e4829c/pandas_redistrict-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d8a335e4c668ad9971d8a2ee904d6ef", "sha256": "0c37b7f69c5082525112760ae795288b9d46376e5ba42654e54c62212392b45f" }, "downloads": -1, "filename": "pandas-redistrict-0.0.3.tar.gz", "has_sig": false, "md5_digest": "1d8a335e4c668ad9971d8a2ee904d6ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41912, "upload_time": "2015-09-08T10:34:25", "url": "https://files.pythonhosted.org/packages/74/9d/8447a3dd3e05eac83687420f7e3e07658df9d574d576c6c5b601829dbcd6/pandas-redistrict-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ec8f3f5614a47d0e627943143ec5d869", "sha256": "5341ced47920ab6432228c3426022186c186f91983fbb5e397e5c3f2dee8029f" }, "downloads": -1, "filename": "pandas_redistrict-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ec8f3f5614a47d0e627943143ec5d869", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 43167, "upload_time": "2015-09-08T10:33:59", "url": "https://files.pythonhosted.org/packages/55/14/ee5b95358f8c5833331b8f7d8bf6133855b6c7b6f3118e58ea0f38e4829c/pandas_redistrict-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d8a335e4c668ad9971d8a2ee904d6ef", "sha256": "0c37b7f69c5082525112760ae795288b9d46376e5ba42654e54c62212392b45f" }, "downloads": -1, "filename": "pandas-redistrict-0.0.3.tar.gz", "has_sig": false, "md5_digest": "1d8a335e4c668ad9971d8a2ee904d6ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41912, "upload_time": "2015-09-08T10:34:25", "url": "https://files.pythonhosted.org/packages/74/9d/8447a3dd3e05eac83687420f7e3e07658df9d574d576c6c5b601829dbcd6/pandas-redistrict-0.0.3.tar.gz" } ] }