def find_nearest(array, value):
    """
    Smart and small function to find the index of the nearest value, in an array, of some other value

    Parameters
    -----------
    array: array
        list or array
    value: float
        value to look for in the array
    """
    import numpy as np
    idx = np.abs(array - value).argmin()
    return idx
