momepy.simpson_diversity

momepy.simpson_diversity(values, bins=None, categorical=False)[source]

Calculates the Simpson’s diversity index of data. Helper function for momepy.Simpson.

\[\lambda=\sum_{i=1}^{R} p_{i}^{2}\]
Parameters:
values : pandas.Series

A list of values.

bins : array, optional

An array of top edges of classification bins. Should be equal to the result of binning.bins.

categorical : bool (default False)

Treat values as categories (will not use bins).

Returns:

Simpson’s diversity index.

Return type:

float

See also

momepy.Simpson

Calculates the Simpson’s diversity index.