[NumPy-Tickets] [NumPy] #1656: genfromtxt bug with delimiter is int type
NumPy Trac
numpy-tickets@scipy....
Sun Oct 31 06:12:06 CDT 2010
#1656: genfromtxt bug with delimiter is int type
----------------------+-----------------------------------------------------
Reporter: sunqiang | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: 1.5.1
Component: Other | Version: 1.5.0
Keywords: |
----------------------+-----------------------------------------------------
from userguide
http://docs.scipy.org/doc/numpy/user/basics.io.genfromtxt.html#the-
delimiter-argument (the second example):
>>> import numpy as np
>>> from StringIO import StringIO
>>> data = " 1 2 3\n 4 5 67\n890123 4"
>>> np.genfromtxt(StringIO(data), delimiter=3)
------------------------------------------------------------
Traceback (most recent call last):
File "<ipython console>", line 1, in <module>
File "C:\Python27\lib\site-packages\numpy\lib\npyio.py", line 1451, in
genfrom
txt
raise ValueError(errmsg)
ValueError: Some errors were detected !
Line #3 (got 3 columns instead of 4)
>>> np.__version__
'1.5.1rc1'
quick and dirty fix:
insert "line = line.rstrip()" at line 212 of C:\Python27\Lib\site-
packages\numpy\lib\_iotools.py, aka, the first line of method
_fixedwidth_splitter(self, line) of class LineSplitter:
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1656>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list