[Numpy-discussion] can savetxt write arrays with ndim > 2 ?
Tue Sep 28 03:26:28 CDT 2010
I tried to savetxt an array with ndim = 3, but I get an error:
In : savetxt('test.dat',a)
in savetxt(fname, X, fmt, delimiter)
785 for row in X:
--> 786 fh.write(format % tuple(row) + '\n')
788 import re
TypeError: float argument required, not numpy.ndarray
I don't see this anywhere in the documentation of savetxt. And if that is a
restriction it should probably be caught with an assertion.
Numpy version 1.4.0.
I see why ndim>2 may cause problems, as there is now way on 'loadtxt' to
figure out the shape of the array, but I think it should throw an assertion
and the documentation should be updated.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion