[Numpy-discussion] Extracting data from genfromtxt?
rohaq at dearinternet.com
Sat Mar 19 10:58:41 EDT 2011
On Sat, Mar 19, 2011 at 01:52, Ben Gamari <bgamari.foss at gmail.com> wrote:
> On Fri, 18 Mar 2011 20:27:17 +0000, Rohaq <rohaq at dearinternet.com> wrote:
> > There could be a lot more than 2 other columns, Result3,Result4, etc.,
> > so I need to code it to be scalable; if this were acting like a normal
> > dict, I could write a loop that iterates over the keys, and loads the
> > results data into a new object, but I can't seem to find a function
> > that will return the keys so that I can do this.
> You could also iterate over data.dtype.fields, which will behave much
> like dict.keys().
> - Ben
Actually I just found last night I could iterate over data.dtype.names, and
unlike fields, it seems to print them in the order of the columns from the
CSV file :)
Thanks for your help though!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion