import numpy as np


def entropy(y):
    # use numpy.unique to obtain sorted unique elements and their counts
    _, counts = # TODO
    # calculate the proportion of each class in the whole dataset
    # the return value should be an array of proportions
    p = # TODO
    # calculate and return entropy using the formula from the task
    # logarithm can be calculated using the numpy.log2 function
    return # TODO
