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

Alan G Isaac alan.isaac at gmail.com
Sat Nov 1 10:54:40 EDT 2014

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 just not understanding the question, but the initial
answer I will give is, "just like the proposal for `max_rows`".

That is, skip_header and skip_footer are honored, and the remainder
of the file is sliced. For the equivalent of say `max_rows=500`,
one would say `slice_rows=slice(500)`.

Perhaps you could provide an example illustrating the issues this
reply overlooks.


More information about the NumPy-Discussion mailing list