This library execute voter participation rate analysis for the Quality of Life Exporer variables
Project description
Voter Participation Analysis for QOL
This package provides a Python class voters
for analyzing voter participation rate for Urban Institute's Quality of Life (QOL) variables. It includes methods for spatial joining, summarizing voter data by NPA (Neighborhood Planning Area), and exporting the results to a CSV file.
Installation
Install voters
from PyPI using pip:
pip install qolvoters
Usage
import pandas as pd import arcpy import qolvoters as vt
Example usage:
voter_analysis = vt.voters('GeocodedVoterPointAddresses', 'NPA_FeatureClass', 'SummaryTable')
Summarize voter data by NPA
voter_analysis.summary('ActiveVoters', 'Join_Count')
Export summarized results to a CSV file
voter_analysis.export('OutputDirectory', 'VoterParticipationSummary.csv')
Methods
__init__(self, voterparticipation, NPA, SummaryTableName)
Initialize the voters class with the following parameters:
-
voterparticipation: Geocoded voter participation feature class.
-
NPA: NPA feature class.
-
SummaryTableName: Name of the summary table for voters in each NPA.
Assign NPA IDs to each voter by performing a spatial join between the voter participation feature class and the NPA feature class.
summary(self, *FieldsToBeSummarized)
Compute the summary of all voters within each NPA. Takes parameters for the fields to be summarized (e.g., active voters field and the 'Join_Count' field).
export(self, OutputDirectory, FinalCSVName)
Export the results of the voter participation analysis to a CSV file. Renames columns and computes additional fields before exporting the final CSV file.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file qolvoters-1.0.tar.gz
.
File metadata
- Download URL: qolvoters-1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43ba4895251999a72b2fa2df3bb1cd8e58d6c557c6770acb331f19a0590cf158 |
|
MD5 | bd511f03d73cf8297dd13d50f1556e24 |
|
BLAKE2b-256 | 74f16f8576b34ec1ea0f6d074228c15d8bcbfb5e98c021d50acd62bb98ffdcdd |
File details
Details for the file qolvoters-1.0-py3-none-any.whl
.
File metadata
- Download URL: qolvoters-1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9099c28a6ca7e7792fd2569204262b6f88a2318b5ee0ca0402929014fc9d6688 |
|
MD5 | 18945c4ae8b4359428ad64d31121c434 |
|
BLAKE2b-256 | b75bfe33f746775a8cf7ab91dc364de71a6bb66458c4eeb20f29e3bad3d49a6c |