Skip to content

jpcarroll/Econopy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Econopy


Economic Inequality Metrics in Python for My Thesis

  • Supports Python 2 and 3
  • Requires Numpy and Matplotlib

Setup

  • Installation
  • Examples

Installation:

$ git clone https://github.com/jpcarroll/Econopy.git
$ cd Econopy

Examples:

import econopy as ep
import numpy as np

j = np.array([241,104,93,346,228,487,173,222,9,188])

k = np.array([299,427,317,311,269,263,22,342,382,159])

l = np.array([-330,0,322,273,156,25,52,186,308,315])

To calculate the Gini Coefficient:

print (ep.gini(j))
$  0.332711621234

To calculate the Hill's alpha parameter:

print (ep.hill(k))
$  1.42639302646

To graph a Cumulative distribution function (CDF):

ep.cdf(j) 

CDF

The Gini coefficient can also accept zeros and negative numbers:

print (ep.gini(l))
$  0.77895944912

About

Economic Inequality Metrics in Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages