[Numpy-discussion] Array search considering order

rootspin andrei at ruivo.org
Thu Dec 19 07:51:05 EST 2013


Need some help in searching arrays (Im new to numpy)
Is it possible to search a array, using another array considering

x = np.array([1,2,3,4,5,6], np.int32)

y = np.array([1,4,3,2,6,5], np.int32)

query= np.array([1,2,3],np.int32)

x versus query True
y versus query False

Tried with: 

np.searchsorted(x,query)  -------> array([0, 1, 2])
np.searchsorted(y,query)  -------> array([0, 1, 4])


View this message in context: http://numpy-discussion.10968.n7.nabble.com/Array-search-considering-order-tp35911.html
Sent from the Numpy-discussion mailing list archive at Nabble.com.

More information about the NumPy-Discussion mailing list