Re: [Numpy-discussion] Extracting data from genfromtxt?

2011-03-18 Thread Ben Gamari
On Fri, 18 Mar 2011 20:27:17 +, Rohaq 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 objec

Re: [Numpy-discussion] Extracting data from genfromtxt?

2011-03-18 Thread Skipper Seabold
On Fri, Mar 18, 2011 at 4:27 PM, Rohaq wrote: > I've got a CSV file with the following layout: > > Location,Result1,Result2 > 1,0,0 > 2,0,0 > 3,1,0 > 4,1,0 > 5,1,1 > 6,0,1 > 7,0,1 > 8,0,0 > > ...etc., and I've loaded it using the following: > > import numpy as np > data = np.genfromtxt('file.csv',

[Numpy-discussion] Extracting data from genfromtxt?

2011-03-18 Thread Rohaq
I've got a CSV file with the following layout: Location,Result1,Result2 1,0,0 2,0,0 3,1,0 4,1,0 5,1,1 6,0,1 7,0,1 8,0,0 ...etc., and I've loaded it using the following: import numpy as np data = np.genfromtxt('file.csv',delimiter=',',dtype=None,names=True) Resulting in the following: array([(1