def normalize(array):
    """Normalize the values of a Numpy array in the range [0,1].

    Parameters
    ----------
    array : array like
        The array to normalize

    Returns
    -------
    ndarray
        The normalized array
    """
    min_value = array.min()
    max_value = array.max()
    size = max_value - min_value

    if size > 0:
        array = array.astype('float64', copy=True)
        norm_array = (array - min_value)/size
    else:
        norm_array = array

    return norm_array