Re: file data => array(s)

2011-12-15 Thread MRAB
On 15/12/2011 18:37, Eric wrote: [snip] Neat. This is what I had in mind for a python-esque solution. [snip] FYI, the word is "Pythonic" when talking about the programming language. The word "Pythonesque" refers to Monty Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: file data => array(s)

2011-12-15 Thread Eric
On Dec 14, 4:59 pm, Dave Angel wrote: > On 12/14/2011 05:20 PM, Eric wrote: > > > > > > > > > I'm trying to read some file data into a set of arrays.  The file data > > is just four columns of numbers, like so: > > >     1.2    2.2   3.3  0.5 > >     0.1   0.2    1.0  10.1 > >     ... and so on >

Re: file data => array(s)

2011-12-15 Thread Eric
On Dec 14, 5:27 pm, Steven D'Aprano wrote: > On Wed, 14 Dec 2011 14:20:40 -0800, Eric wrote: > > I'm trying to read some file data into a set of arrays.  The file data > > is just four columns of numbers, like so: > > >    1.2    2.2   3.3  0.5 > >    0.1   0.2    1.0  10.1 > >    ... and so on >

Re: file data => array(s)

2011-12-14 Thread Steven D'Aprano
On Wed, 14 Dec 2011 14:20:40 -0800, Eric wrote: > I'm trying to read some file data into a set of arrays. The file data > is just four columns of numbers, like so: > >1.22.2 3.3 0.5 >0.1 0.21.0 10.1 >... and so on > > I'd like to read this into four arrays, one array f

Re: file data => array(s)

2011-12-14 Thread Eric
On Dec 14, 4:59 pm, Dave Angel wrote: > Note that your code won't work (and mine probably won't either) if one > of the lines has 3 or 5 items.  Or if one of the numbers isn't legal > format for a float.  So you need to think about error checking, or > decide whether a partial result is important

Re: file data => array(s)

2011-12-14 Thread Dave Angel
On 12/14/2011 05:20 PM, Eric wrote: I'm trying to read some file data into a set of arrays. The file data is just four columns of numbers, like so: 1.22.2 3.3 0.5 0.1 0.21.0 10.1 ... and so on I'd like to read this into four arrays, one array for each column. Alternat

file data => array(s)

2011-12-14 Thread Eric
I'm trying to read some file data into a set of arrays. The file data is just four columns of numbers, like so: 1.22.2 3.3 0.5 0.1 0.21.0 10.1 ... and so on I'd like to read this into four arrays, one array for each column. Alternatively, I guess something like this is oka