Skip to main content

Quantile normalization

Project description

qnorm

PyPI version Anaconda version tests

quantile normalization made easy.

Quick example

We recreate the example of Wikipedia:

import pandas as pd
import qnorm

df = pd.DataFrame({'C1': {'A': 5, 'B': 2, 'C': 3, 'D': 4},
                   'C2': {'A': 4, 'B': 1, 'C': 4, 'D': 2},
                   'C3': {'A': 3, 'B': 4, 'C': 6, 'D': 8}})

print(qnorm.quantile_normalize(df))

which is what we expect:

         C1        C2        C3
A  5.666667  5.166667  2.000000
B  2.000000  2.000000  3.000000
C  3.000000  5.166667  4.666667
D  4.666667  3.000000  5.666667

The function quantile_normalize also accepts numpy arrays.

Installation

pip

pip install qnorm

conda

Installing qnorm from the conda-forge channel can be achieved by adding conda-forge to your channels with:

conda config --add channels conda-forge

Once the conda-forge channel has been enabled, qnorm can be installed with:

conda install qnorm

local

clone the repository

git clone https://github.com/Maarten-vd-Sande/qnorm

And install it

cd qnorm
pip install .

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

qnorm-0.1.1.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

qnorm-0.1.1-py3-none-any.whl (6.5 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