diff --git a/modules/util/util.py b/modules/util/util.py index 5831c5ba10b7fe313bd763f78d1efc1515db735c..872ed3d7e3ae5243c2791969c22368fa10d379aa 100644 --- a/modules/util/util.py +++ b/modules/util/util.py @@ -291,7 +291,8 @@ def minimize_quadratic(xa, xb, xc, ya, yb, yc): return x_m -# Return index of nda closest to value. nda must be 1d +# Return index of nda closest to value. nda (numpy.ndarray) must be 1d. If multiple occurrences should arise, +# the first is returned according to NumPy's argmin/max function. def value_to_index(nda, value): diff = np.abs(nda - value) idx = np.argmin(diff)