|
From: per f. <per...@gm...> - 2009-10-01 17:21:22
|
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. |