What's this How to execute the function savetxt () that saves ndarray to a file in append mode.
savetxt.py
import numpy
a = [[3, 4, 5], [6, 7, 8], [9, 10, 11]]
nda = numpy.array(a)
a2 = [[-3, -4, -5], [-6, -7, -8], [-9, -10, -11]]
nda2 = numpy.array(a2)
with open('output.txt', 'a') as f_handle:
numpy.savetxt(f_handle, nda)
numpy.savetxt(f_handle, nda2)
http://stackoverflow.com/questions/17731419/appending-a-matrix-to-an-existing-file-using-numpy http://stackoverflow.com/questions/19793692/strings-and-arraysmatrix-row-wise-numpy-savetxt
Recommended Posts