Skip to main content

Python package for calculating correlation amongst categorical variables

Project description

PyCorr

A simple library to calculate correlation between variables. Currently provides correlation between nominal variables.

Based on statistical methodology like Cramer'V and Tschuprow'T allows to gauge the correlation between categorical variables. Ability to plot the correlation in form of heatmap is also provided.

Usage example

import pandas as pd
from pycorrcat.pycorrcat import plot_corr, corr_matrix

df = pd.DataFrame([('a', 'b'), ('a', 'd'), ('c', 'b'), ('e', 'd')],
                  columns=['dogs', 'cats'])

correlation_matrix = corr_matrix(data, ['dogs', 'cats'])
plot_corr(df, ['dogs','cats'] )

Development setup

Create a virtualenv and install dependencies:

  • pip install -r requirements.dev.txt
  • pip install -r requirements.txt Then install the pre-commit hooks: pre-commit install and continue with code change.

Run pre-commit locally to check files

pre-commit run --all-files

Release History

  • 0.1.4
    • CHANGE: Changed the documentation (no code change)
  • 0.1.3
    • ADD: Ability to pass dataframe to get correlation matrix
    • ADD: Ability to plot the correlation in form of heatmap
  • 0.1.2
    • Added as first release
  • 0.1.1
    • Test release

Author and Contributor

Anurag Kumar Mishra – Connect on github or drop a mail

Distributed under the GNU license. See LICENSE for more information.

Github repo link https://github.com/MavericksDS/pycorr

Contributing

  1. Fork it (https://github.com/MavericksDS/pycorr)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

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

pycorr-0.1.5.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

pycorr-0.1.5-py3-none-any.whl (17.0 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