Newish np.stack gives more control over the new axis:
In [37]: a = [1,2,3,4,5]
In [38]: b = [6,7,8,9,10]
In [39]: np.stack((a,b), axis=1)
Out[39]:
array([[ 1, 6],
[ 2, 7],
[ 3, 8],
[ 4, 9],
[ 5, 10]])
In [40]: _.shape
Out[40]: (5, 2)
With the default axis=0, it behaves like np.array, producing a (2,5) array.
vstack docs notes:
This function continues to be supported for backward compatibility, but
you should prefer np.concatenate or np.stack. The np.stack
function was added in NumPy 1.10.
I think that's overstating the case, but still, stack is one of my favorite new functions. I also recommend looking at the Python code for functions like this. Most end up using concatenate after fiddling with the dimensions of the inputs.
np.vstack((a, b)).Tnp.array([a,b]).T