At: How to write numpy arrays to .txt file, starting at a certain line?
People helped me to solve my problem - this works for numpy Version 1.7 or later. Unfortunatelly I have to use the version 1.6 - the follwoing code (thank you @Praveen)
extra_text = 'Answer to life, the universe and everything = 42'
header = '# Filexy\n# time operation1 operation2\n' + extra_text
np.savetxt('example.txt', np.c_[time, operation1, operation2],
header=header, fmt='%d', delimiter='\t', comments=''
give me an error with numpy 1.6
numpy.savetxt() got an unexpected keyword argument 'header' · Issue ...
Is there a work-around for Version 1.6 that produces the same result:
# Filexy
# time operation1 operation2
Answer to life, the universe and everything = 42
0 12 100
60 23 123
120 68 203
180 26 301