indexing lists/arrays question

a oxfordenergyservices at googlemail.com
Thu May 13 10:36:58 EDT 2010


this must be easy but its taken me a couple of hours already

i have

a=[2,3,3,4,5,6]

i want to know the indices where a==3 (ie 1 and 2)

then i want to reference these in a

ie what i would do in IDL is

b=where(a eq 3)
a1=a(b)

any ideas?

Thanks




More information about the Python-list mailing list