def wherechanged(arr):
    """
    Returns the indices where a list changes values

    Parameters
    ----------
    arr : array or list
        the array or list that may contain changes

    Returns
    ------
    where :
        a list of indices that changes occur
    """
    where = []
    for i in range(len(arr) - 1):
        diff = arr[i + 1] ^ arr[i]
        if diff != 0:
            where.append(i + 1)
    return where