Re: [Numpy-discussion] loadtxt and N/A

2008-07-13 Thread Lorenzo Bolla
you can use the 'converters' keyword in numpy.loadtxt. first define a function to convert a string in a float, that can handle your 'N/A' entries: def converter(x): if x == 'N/A': return numpy.nan else: return float(x) then use: >>> numpy.loadtxt('test.dat', converters={1

[Numpy-discussion] loadtxt and N/A

2008-07-13 Thread Bryan Fodness
I am using loadtxt and I have missing values that are show up as N/A. I get a, ValueError: invalid literal for float(): N/A Is there a way to ignore these? ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/l