Inequality Coefficients:
This is small library with some implemented coefficients (or indices) intended to measure inequality or concentration of the values in a population.
Implemented coefficients
- Gini Coefficient:
- Ordinary
- Corrected: Using a correction for small datasets based on Deltas, 2003.
- Ratio top / rest
Installation
This library is hosted on PyPI, so installation is straightforward. The easiest way to install type this at the command line (Linux, Mac, or Windows):
pip install inequality_coefficients
This library also depends on numpy, but pip should take of that for
you already.
Basic Usage
For the simplest, typical use cases, this tells you everything you need to know.:
import inequality_coefficients as ineq
data = array([1.7, 3.2 ...]) # data can be list of nums or numpy array
gini_coeff = ineq.gini_coeff(data)
ratio_top_rest = ineq.ratio_top10_rest(data)
Acknowledgements
Firstly, I was based on Felipe Ortega's wikixray code for implementing the gini coefficient, however, my code has changed so much and I'm using numpy as backend.
Anyway, I want to thank him for open sourcing that project.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inequality_coefficients-1.1.0.linux-x86_64.tar.gz.
File metadata
- Download URL: inequality_coefficients-1.1.0.linux-x86_64.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.5.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d957eda00373021a85536f0d89f41ae3ae6e9a665270820601b3abb8205b3e5b
|
|
| MD5 |
baa80a83f83116a574c2d7a7e24941b3
|
|
| BLAKE2b-256 |
3caecfe68ba0b8cc4b9a7471e4cc4217e6fe310712565f59e2cb5f66e511a3b3
|
File details
Details for the file inequality_coefficients-1.1.0-py3-none-any.whl.
File metadata
- Download URL: inequality_coefficients-1.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
Python-urllib/3.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c59ea66fc816bab457f15e8091f07d2ab3c9890a2adbdc22953978bd5c9ae0b9
|
|
| MD5 |
6ae6e617737fcca9e8ff54c4eb18d1d6
|
|
| BLAKE2b-256 |
c96d8dbdb5dd8cdc8a78b62a7f02bc817455130aa657ac75c272973aba301105
|