[Numpy-discussion] loadtxt stop

Zachary Pincus zachary.pincus at yale.edu
Fri Sep 17 16:04:25 EDT 2010


On Sep 17, 2010, at 3:59 PM, Benjamin Root wrote:

> So, this code will still raise an error for an empty file.   
> Personally, I consider that a bug because I would expect to receive  
> an empty array.  I could understand raising an error for a non-empty  
> file that does not contain anything useful.  For comparison, Matlab  
> returns an empty matrix for loading an emtpy text file.
>
> This has been a long-standing annoyance for me, along with the  
> behavior with a single-line data file.

Agreed... I just wanted to make the patch as identical in behavior to  
the old version as possible. Though again, simple shims around loadtxt  
(as in my previous examples) can yield the desired behavior easily  
enough.




More information about the NumPy-Discussion mailing list