Skip to content

Home / Glossary / Gini Coefficient

Economics

Gini Coefficient

Single-number measure of income or wealth inequality (0–1).

0 means perfect equality (everyone earns the same); 1 means one person has everything. It is the area between the Lorenz curve and the line of equality. Most developed economies sit around 0.3–0.4.

Formula / theory

G = (Σ_i Σ_j |x_i − x_j|) / (2 n² x̄)

In Python

import numpy as np
def gini(x):
    x = np.sort(np.asarray(x, float))
    n = len(x)
    return (2 * np.sum((np.arange(1, n + 1)) * x)
            / (n * x.sum())) - (n + 1) / n

Related terms