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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycorr-0.1.5-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file pycorr-0.1.5.tar.gz.

File metadata

  • Download URL: pycorr-0.1.5.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.1

File hashes

Hashes for pycorr-0.1.5.tar.gz
Algorithm Hash digest
SHA256 f5e97d84e94bcd6c2d3a0c33865f23a1829b91c9ac0f92f3af12bf75783d722f
MD5 47cc2c322d46c4df94b1be4801c5ff39
BLAKE2b-256 48b1df097e13f48e41a268f938952b7ba41dce2a150a65d7284b6857c3c0c819

See more details on using hashes here.

File details

Details for the file pycorr-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: pycorr-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.1

File hashes

Hashes for pycorr-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 79515681afb7d65d4396c2d95170fad96ef3dc9effbe3fa8aa432bccb0504f21
MD5 e8fda149faa67536bd24fbb7a060cf70
BLAKE2b-256 14caaf5fb1b70a90e18e77c91c347ed72ffa7a255a0a911322be9ad800ae81bf

See more details on using hashes here.

Supported by

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