subset1, subset2 = divide_data(data, column, cut_point)
lensub1, lensub2 = len(subset1), len(subset2)
if len(subset1) == 0 or len(subset2) == 0:
    return 0, subset1, subset2
weighted_ent = (len(subset1) * entropy(subset1) + len(subset2) * entropy(
    subset2)) / len(data)
return entropy(data) - weighted_ent, subset1, subset2
Calculating the entropy of an attribute in the ID3 algorithm when a split is perfectly classified