Calculate the Gini Impurity for a list of samples.

    See:
    https://en.wikipedia.org/wiki/Decision_tree_learning#Gini_impurity

def gini_impurity(s):
    """Calculate the Gini Impurity for a list of samples.

    See:
    https://en.wikipedia.org/wiki/Decision_tree_learning#Gini_impurity
    """
    return 1 - sum(prop(s[i], s)**2 for i in range(len(s)))