import numpy as np R = np.array([[0.62367947], [0.95427859], [0.97984112], [0.7025228], [0.86436385], [0.71010739], [0.98748138], [0.75198057]]) phase = np.array([[-1., 1., -1.], [-1., 1., 1.], [1., 1., 1.], [1., -1., 1.], [-1., -1., -1.], [1., 1., -1.], [1., -1., -1.], [-1., -1., 1.]]) np.savetxt('R2.txt', np.hstack([R, phase]), fmt=['%0.8f','%g','%g','%g'])
gives
0.62367947 -1 1 -1 0.95427859 -1 1 1 0.97984112 1 1 1 0.70252280 1 -1 1 0.86436385 -1 -1 -1 0.71010739 1 1 -1 0.98748138 1 -1 -1 0.75198057 -1 -1 1
np.hstack horizontal stacks of arrays. Since R and phase are both two-dimensional, np.hstack([R, phase]) gives
In [137]: np.hstack([R,phase]) Out[137]: array([[ 0.62367947, -1. , 1. , -1. ], [ 0.95427859, -1. , 1. , 1. ], [ 0.97984112, 1. , 1. , 1. ], [ 0.7025228 , 1. , -1. , 1. ], [ 0.86436385, -1. , -1. , -1. ], [ 0.71010739, 1. , 1. , -1. ], [ 0.98748138, 1. , -1. , -1. ], [ 0.75198057, -1. , -1. , 1. ]])
Passing this 2D array to np.savetxt gives the desired result.