我有一个包含多个列的.txt文件,我想替换另一列的第一列。我正在尝试以下方法:
JD[] #Are the data for which I want to replace the first column of the file.
with open('filedata.txt', 'r') as f:
print f.readline().rstrip('\n')
for value, line in zip(JD, f)
elements = line.split()
A = format(value,elements[1:])
np.savetxt(A)