gini function
The gini function returns the Gini index of the column, evaluated within groups defined by the group parameter if required.
The Gini index is a measure of statistical dispersion.
The Gini index is included between 0 and +1, where:
0 indicates perfect equality between values, and
+1 indicates maximum inequality between values.
Function and parameters
gini(column, group, usemissing)
Parameter | Description |
---|---|
column | It identifies the column to which you want to apply the formula. The column parameter is mandatory. |
group | It allows you to group the results by a certain column. |
usemissing | A Boolean which indicates whether missing values should be considered or not in the computation of the statistics. The default value, if not otherwise specified, is True. |
Example
The following example uses the Adult dataset.
Description | Screenshot |
---|---|
| |
|