[Numpy-discussion] loadtxt slow

Eric Firing efiring at hawaii.edu
Sun Mar 1 21:47:05 EST 2009


Gideon Simpson wrote:
> So I have some data sets of about 160000 floating point numbers stored  
> in text files.  I find that loadtxt is rather slow.  Is this to be  
> expected?  Would it be faster if it were loading binary data?

Depending on the format you may be able to use numpy.fromfile, which I 
suspect would be much faster.  It only handles very simple ascii 
formats, though.

Eric



More information about the NumPy-Discussion mailing list