I am looking for a numpy function to find the indices at which certain values are found within a vector (xs). The values are given in another array (ys). The returned indice
In this kind of cases, just easily use np.isin() function to mask those elements conform your conditions, like this:
xs = np.asarray([45, 67, 32, 52, 94, 64, 21]) ys = np.asarray([67, 94]) mask=xs[np.isin(xs,xy)] print(xs[mask])