I see that Pandas has read_fwf, but does it have something like DataFrame.to_fwf? I\'m looking for support for field width, numerical precision, a
read_fwf
DataFrame.to_fwf
For custom format for each column you can set format for whole line. fmt param provides formatting for each line
with open('output.dat') as ofile: fmt = '%.0f %02.0f %4.1f %3.0f %4.0f %4.1f %4.0f %4.1f %4.0f' np.savetxt(ofile, df.values, fmt=fmt)