Re: [Numpy-discussion] Add `nrows` to `genfromtxt`

2014-11-01 Thread Warren Weckesser
On 11/1/14, Alan G Isaac wrote: > On 11/1/2014 3:15 PM, Warren Weckesser wrote: >> I intended the result of `genfromtxt(..., max_rows=n)` to produce the same >> array as produced by `genfromtxt(...)[:n]`. > > I find that counterintuitive. > I would first honor skip_header. Sorry for the terse ex

Re: [Numpy-discussion] Add `nrows` to `genfromtxt`

2014-11-01 Thread Warren Weckesser
On 11/1/14, Alan G Isaac wrote: > On 11/1/2014 4:41 PM, Alexander Belopolsky wrote: >> I cannot think of a situation where I would need more generality such as >> reading every 3rd row or rows with the given numbers. Such processing is >> normally done after the text data is loaded into an array.

Re: [Numpy-discussion] Add `nrows` to `genfromtxt`

2014-11-01 Thread Alan G Isaac
On 11/1/2014 3:15 PM, Warren Weckesser wrote: > I intended the result of `genfromtxt(..., max_rows=n)` to produce the same > array as produced by `genfromtxt(...)[:n]`. I find that counterintuitive. I would first honor skip_header. Cheers, Alan ___ Num

Re: [Numpy-discussion] Add `nrows` to `genfromtxt`

2014-11-01 Thread Alan G Isaac
On 11/1/2014 4:41 PM, Alexander Belopolsky wrote: > I cannot think of a situation where I would need more generality such as > reading every 3rd row or rows with the given numbers. Such processing is > normally done after the text data is loaded into an array. I have done this as cheaper than r

Re: [Numpy-discussion] Add `nrows` to `genfromtxt`

2014-11-01 Thread Alexander Belopolsky
On Sat, Nov 1, 2014 at 3:15 PM, Warren Weckesser wrote: > Is there wider interest in such an argument to `genfromtxt`? For my > use-cases, `max_rows` is sufficient. I can't recall ever needing the full > generality of a slice for pulling apart a text file. Does anyone have > compelling use-cas

Re: [Numpy-discussion] Add `nrows` to `genfromtxt`

2014-11-01 Thread Warren Weckesser
On Sat, Nov 1, 2014 at 10:54 AM, Alan G Isaac wrote: > On 11/1/2014 10:31 AM, Warren Weckesser wrote: > > Alan's suggestion to use a slice is interesting, but I'd like to > > see a more concrete proposal for the API. For example, how does > > it interact with `skip_header` and `skip_footer`? Ho

[Numpy-discussion] np.float64 * Python list vs np.float64 + Python list

2014-11-01 Thread Bas Swinckels
Hi group, I just answered a question on Stackoverflow from some new user, who was bitten by some unexpected behavior when using a list instead of a np.array, see here: http://stackoverflow.com/q/26690480/2647279 The unexpected thing that triggered the error is that multiplying a list with a Numpy

Re: [Numpy-discussion] Add `nrows` to `genfromtxt`

2014-11-01 Thread Alan G Isaac
On 11/1/2014 10:31 AM, Warren Weckesser wrote: > Alan's suggestion to use a slice is interesting, but I'd like to > see a more concrete proposal for the API. For example, how does > it interact with `skip_header` and `skip_footer`? How would one > use it to read a file in batches? I'm probably

Re: [Numpy-discussion] Add `nrows` to `genfromtxt`

2014-11-01 Thread Warren Weckesser
On 9/24/14, Alan G Isaac wrote: > On 9/24/2014 2:52 PM, Jaime Fernández del Río wrote: >> There is a PR in github that adds a new keyword to the genfromtxt >> function, to limit the number of rows that actually get read in: >> https://github.com/numpy/numpy/pull/5103 > > Sorry to come late to this