<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_nearest_index(arr, value):
 """For a given value, the function finds the nearest value in the array and returns its index."""

    arr = np.array(arr)
    index = (abs(arr-value)).argmin()
    return index