What's this
ndarrayをファイルに保存する関数savetxt()をappendモードで行う方法。
#コード
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