[Numpy-discussion] numpy where function on different sized arrays

Siegfried Gonzi sgonzi@staffmail.ed.ac...
Sat Nov 24 14:36:45 CST 2012


Hi all
 
This must have been answered in the past but my google search capabilities are not the best.
 
Given an array A say of dimension 40x60 and given another array/vector B of dimension 20 (the values in B occur only once).
 
What I would like to do is the following which of course does not work (by the way doesn't work in IDL either):
 
indx=where(A == B)
 
I understand A and B are both of different dimensions. So my question: what would the fastest or proper way to accomplish this (I found a solution but think is rather awkward and not very scipy/numpy-tonic tough).
 
Thanks
-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the NumPy-Discussion mailing list