[Numpy-discussion] using loadtxt() for given number of rows?

Christopher Barker Chris.Barker@noaa....
Mon Feb 14 10:41:17 CST 2011

On 2/14/11 8:28 AM, Stéfan van der Walt wrote:
> You can always read chunks of the file into StringIO objects, and pass
> those into loadtxt.

true, but there isn't any single method for loading n lines of a file 
into a StringIO object, either. I"ve always thought that 
file.readlines() should take a number of rows as an optional parameter.

not a big deal, now that we have list comprehensions, but still it would 
be nice, and it makes sense to put it into loadtxt() for sure.


Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception


More information about the NumPy-Discussion mailing list