numpy.savetxt(fname, X, fmt='%.18e', delimiter=' ', newline='
',
header='', footer='', comments='# ', encoding=None)
x = y = z = np.arange(0.0,5.0,1.0)
np.savetxt('test.out', x, delimiter=',') # X is an array
np.savetxt('test.out', (x,y,z)) # x,y,z equal sized 1D arrays
np.savetxt('test.out', x, fmt='%1.4e') # use exponential notation
# We create a rank 1 ndarray
x = np.array([1, 2, 3, 4, 5])
# We save x into the current directory as
np.save('my_array', x)
# We load the saved array from our current directory into variable y
y = np.load('my_array.npy')