def nonZeroIndex(arr):
    """
    :param arr: a numpy 1-D array.

    Returns the list of indices of nonzero elements in ``arr``. \n
    Example: [0,0,0,1] => [4]

    """
    return arr.nonzero()[0]