[Numpy-tickets] [NumPy] #623: loadtxt fails with record arrays
NumPy
numpy-tickets@scipy....
Sat Dec 1 11:31:10 CST 2007
#623: loadtxt fails with record arrays
------------------------+---------------------------------------------------
Reporter: mstarzyk | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: 1.0.5
Component: numpy.core | Version:
Severity: normal | Keywords:
------------------------+---------------------------------------------------
Hi, there is a problem with loading records via loadtxt(). See the example
code below:
{{{
import numpy as N
import StringIO
c = StringIO.StringIO()
c.write('1 2\n3 4')
N.loadtxt(c, dtype=[('x', N.int32), ('y', N.int32)])
}}}
This raises the following exception:
{{{
Traceback (most recent call last):
File "C:\tmp\aa.py", line 6, in <module>
N.loadtxt(c, dtype=[('x', N.int32), ('y', N.int32)])
File "c:\python25\lib\site-
packages\numpy-1.0.4-py2.5-win32.egg\numpy\core\numeric.py", line 726, in
loadtxt
r,c = X.shape
ValueError: need more than 1 value to unpack
}}}
--
Ticket URL: <http://scipy.org/scipy/numpy/ticket/623>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.
More information about the Numpy-tickets
mailing list