[Numpy-discussion] Indexing and lookup issues
Wed Sep 22 15:38:09 CDT 2010
I suspect this is easy but I'm stuck
say I have a 1D array:
t = [10,11,12]
and a 2D array:
id = [[0,1,0]
In could in IDL do y = t[id] which would produce:
y = [[10,11,10]
i.e. use the indexes in id on the lookup array t.
Is there an easy way to do this in numpy?
University of Chicago
Department of Astronomy & Astrophysics
More information about the NumPy-Discussion