[Numpy-discussion] loadtxt example problem ?
Mon May 4 15:06:54 CDT 2009
I'm new to numpy, and considering using loadtxt() to read a data file.
As a starter, I tried the example of the doc page (
>>> from StringIO import StringIO # StringIO behaves like a file object
>>> c = StringIO("0 1\n2 3")
I didn't get the expectd answer, but :
Traceback (moste recent call last):
File"(stdin)", line 1, in <module>
File "C:\Python25\lib\sire-packages\numpy\core\numeric.py", line
725, in loadtxt
X = array(X, dtype)
ValueError: setting an array element with a sequence.
I'm using verison 1.0.4 of numpy).
I got the same problem on a Ms-Windows and a Linux Machine.
I could run the example by adding a \n at the end of c :
c = StringIO("0 1\n2 3\n")
Is it the normal and expected behaviour ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion