If I have an array and I want to set the "close" values for some value as that value, what is the best way to do this? I wonder if for them this is a sterile function. If there is no numpy function, then this is the code below the “best” (ie. Fastest / most efficient) way to do this? It also works for multidimensional arrays.
code:
from numpy import array tol = 1e-5
source share