Income is defined as household disposable income in a particular year. It consists of earnings, self-employment and capital income and public cash transfers; income taxes and social security contributions paid by households are deducted. The income of the household is attributed to each of its members, with an adjustment to reflect differences in needs for households of different sizes.

The Gini coefficient is based on the comparison of cumulative proportions of the population against cumulative proportions of income they receive, and it ranges between 0 in the case of perfect equality and 1 in the case of perfect inequality.

One Gini coefficient is returned per country, for the total population and on the OECD’s current income definition (in use since 2012). The other inequality measures published alongside it in the same dataflow (the P90/P10, P90/P50 and P50/P10 decile ratios, the Palma ratio and the S80/S20 quintile share) are not returned here.

See definition: https://data.oecd.org/inequality/income-inequality.htm

Also known as: Gini coefficient, income distribution.

No programming experience? With the Finance Toolkit MCP server, AI assistants such as Claude and ChatGPT can calculate the Income Inequality for you. Just ask in plain English.

Calculate the Income Inequality in Python

The Income Inequality is available in the Economics module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_income_inequality as shown below.

from financetoolkit import Economics

economics = Economics(start_date='2013-01-01', end_date='2021-12-31')

economics.get_income_inequality(countries=['United States', 'Germany', 'Japan'])

Which returns:

  United States Germany Japan
2013 0.396 0.2922 nan
2014 0.3938 0.2887 nan
2015 0.3896 0.2932 nan
2016 0.3912 0.2944 nan
2017 0.3899 0.2892 nan
2018 0.3927 0.2893 0.334
2019 0.3949 0.2959 nan
2020 0.3773 0.3026 nan
2021 0.3752 0.3125 0.338

Parameters

get_income_inequality accepts the following parameters:

  • countries (list[str] | str | None, optional): The countries to include in the data. Defaults to None.
  • rolling (int, optional): The rolling window size to use for smoothing the data (simple moving average). Defaults to None.
  • trailing (int, optional): The trailing window size to use for summing the data over trailing periods (e.g. a trailing-4-quarter sum). Defaults to None.
  • growth (bool, optional): Whether to return the growth data or the actual data.
  • lag (int, optional): The number of periods to lag the data by.
  • standardize (bool, optional): Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.
  • rounding (int | None, optional): The number of decimals to round the results to. Defaults to None.

The Economics module page introduces the module, and the sidebar lists all of its functions.

Share