import numpy as np

def entropy(x):
    p = x/x.sum()                   # probability for each class
    return (-p*np.log2(p)).sum()    # return entropy


@@ -17,23 +17,524 @@
 np%0A%0A
-def entropy(x):
+# ==============================================================================%0A#                                                                        ENTROPY%0A# ==============================================================================%0Adef entropy(x):%0A    %22%22%22%0A    Takes a 1D numpy array containing the counts for items for different%0A    classes, and it returns the entropy.%0A%0A    :param x: (1D array)%0A    :return: (float)%0A    %22%22%22%0A    # ==========================================================================
 %0A   

Add docstring to entropy()