[Numpy-discussion] Numpy 2.0 schedule
Mon Feb 28 09:25:52 CST 2011
On 02/28/2011 09:02 AM, Benjamin Root wrote:
> So, is there still no hope in addressing this old bug report of mine?
> Ben Root
I think you need to add more details to this. So do you have an example
of the problem that includes code and expected output?
Perhaps genfromtxt is probably more appropriate than loadtxt for what
from StringIO import StringIO
import numpy as np
t = StringIO("1,1.3,abcde\n2,2.3,wxyz\n1\n3,3.3,mnop")
data = np.genfromtxt(t,
[('myint','i8'),('myfloat','f8'),('mystring','S5')], names =
['myint','myfloat','mystring'], delimiter=",", invalid_raise=False)
print 'Bad data raise\n',data
This gives the output that skips the incomplete 3rd line:
ConversionWarning: Some errors were detected !
Line #3 (got 1 columns instead of 3)
Bad data raise
[(1, 1.3, 'abcde') (2, 2.3, 'wxyz') (3, 3.3, 'mnop')]
More information about the NumPy-Discussion