Measuring Equality in Python
June 4, 2017 - Half Moon Bay, California
Distribution inequality can be measured via a Lorenz Curve and/or Gini Coefficient. Here's a best attempt at defining both, in simple terms:


​​What is this used for? A common area is wealth distribution. For example, if one wanted to put a statistical lens over the popular US political slogan, "We are the 99%". Internalizing the Gini Coefficient for a country's distribution of wealth provokes a deeper understanding of the topic, as well as a measurement to contrast against other geographic locations.

The Lorenz Curve and Gini Coefficient can be used to represent the level of inequality in many places outside of wealth distribution as well. For example, it could be used to measure revenue concentration by customers, usage of datasets in a BI Tool, or usage of features in a Web Application.

General steps for computing the Gini Coefficient:


Now, let's rock this out in Python: