array matching

Sam Tannous stannous at
Wed Mar 7 13:51:55 EST 2001

If I have a character array t:

>>> t = array(['abcd','aacd','ddfa','qqcd'])
>>> print t
[[a b c d]
 [a a c d]
 [d d f a]
 [q q c d]]

What's the most efficient way to
create an array that contains the indexes
of the rows that match a particular pattern.

If I want to match a 'c' in the third column,
I'd like the array to look like this:

i = array([0,1,3])


----- End forwarded message -----

More information about the NumPy-Discussion mailing list