array matching

Sam Tannous stannous at cisco.com
Wed Mar 7 12:51:55 CST 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])

Thanks,
Sam

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






More information about the Numpy-discussion mailing list