Below is the illustration code
from pylab import *
a = array([1,2,3])
b = array([4,5])
What I want test.out has is
1 4
2 5
3
previously, people has given solution of store of 1D numpy arrays of different sizes to txt file rowwise: Saving numpy array to txt file row wise
Then how to save them columnwise?
Of course you can use three array like this
a = array([1,4])
b = array([2,5])
c=array([3])
and save them in row wise however it is not a smart way, when there is a lot of 1D arrays.
np.savetxtdoes.savetxtto make it clear that a homespun writer is just as good - better if it handles your problem. This is just an ordinary Python file write problem.