import collections


def get_occurrences(dataset):
    """Turn `dataset` into statistics: elements and theirs occurrences.

    Args:
        dataset (np.array): Dataset of states.

    Returns:
        tuple: np.array of occurrences and np.array of states.

    """
    cntr = collections.Counter(dataset)

    tmp = cntr.items()
    data_hist = list(map(lambda x: x[0], tmp))
    occurs = list(map(lambda x: x[1], tmp))

    return occurs, data_hist