Reading a file with Fortran formatted small floats, using numpy
问题 I am trying to read a data file written by a Fortran program, in which every once in a while there is a very small float like 0.3299880-104 . The error message is: >np.loadtxt(filename, usecols = (1,)) File "/home/anaconda2/lib/python2.7/site-packages/numpy/lib/npyio.py", line 928, in loadtxt items = [conv(val) for (conv, val) in zip(converters, vals)] File "/home/anaconda2/lib/python2.7/site-packages/numpy/lib/npyio.py", line 659, in floatconv return float(x) ValueError: invalid literal for