Skip to main content

Set of tools to measure and run test laid out by the 1982 Voting Rights Amendment

Project description

VRA Results Tests

Voter Power Indexes

Vote Power Index provides tools to run both Banzhaf Power Index and Shapley–Shubik Index to analyse 2 party poltical geographies like US Congresstional Districts to see if the reapproation process maintained Mintorities communties to elect their candidate of choice

Usage

 power_index(df, OtherPopCol, TargetPopCol, Party1, Party2, vIndex=None, filename=None)

Parameters

df - Pandas Dataframe

OtherPopCol - Majority community

TargetPopCol - Minority community

OtherParty - None colitlition party of choice

ColilitionParty - Colitlition party of choice

vIndex (ssi/bpi/none):

  • None both indexes
  • ssi Shapley–Shubik Index
  • bpi Banzhaf Power Inde

filename - optional

Racial Block Voting Tools

Homogeneous Precinct Analysis

 Homogeneous_Precinct(df, MajorityPopCol, MinorityPopCol, TotalPopCol, MajorityParty, MinorityParty)

Ecological Regression Analysis

 Ecological_Regression(df, TotalPopCol, MinorityPopCol, MajorityParty, MinorityParty)

df - pandas Dataframe

MajorityPopCol - Column name for column that has Majority population

MinorityPopCol - Column name for column that has Minority population

TotalPopCol - Column name for column that has Total population

MajorityParty - Column name for column that has Majority Vote

MinorityParty - Column name for column that has Minority Vote

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

VRAresultsTest-0.1.0.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

VRAresultsTest-0.1.0-py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 3

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