您可以使用numpy库。下面的代码应该做到这一点。import numpy as np# assume the data is in.txt filedat = np.loadtxt('in.txt')# -1 means the last columndat[:, -1] = dat[:, -1]/900# write the result to the out.txt file# fmt is the format while writing to the file# %.2f means that it will save it to the 2 digits precisionnp.savetxt('out.txt', dat, fmt='%.2f')