Consider:
import numpy as np
x=np.array([1, 2, 3])
y=x*x
import numpy as np
x=np.array([1, 2, 3])
y=x*x
print np.c_[x,y]
array([[1, 1],
[2, 4],
[3, 9]])
So if you want to save two arrays (of the same size) to file then,
np.savetxt('xy.dat', np.c_[x,y], fmt='%3.4f')
No comments:
Post a Comment