hi all,

i am parsing a csv text file as follows:

data = genfromtxt(filename, delimiter=delimiter, dtype=None, names=True)

this returns an array. sometimes though i want to access the element
that has value x in, say, the first column. i usually do this like
this:

nonzero(data['first_column'] == x)

which returns the indices that match. is there a more efficient way to
do this? i'm willing to assume that the values in this column are
unique, so a dict like structure might work. however, i prefer to use
a built in function that might do something like this... is there a
way to do this with the array returned by genfromtxt for example?

thank you.

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to