I have a list of arrays of same size. The list 'z' holds:
>>> z[0]
Out[24]: array([ -27.56272878, 952.8099842 , -3378.58996244, 4303.9692863 ])
>>> z[1]
Out[25]: array([ -28, 952 , -36244, 2863 ])
>>> z[0].shape
Out[26]: (4,)
I want to concatenate the arrays in the list to obtain a new array which looks like:
-27.56272878 952.8099842 -3378.58996244 4303.9692863
-28 952 -36244 2863
i.e. for the example above I am looking to obtain an array of size ( 2, 4 )
The original list 'z' has about 100 arrays in it but all are of same size (4,)
Edit: I tried suggestions from this threads but doesnt work: Python concatenating different size arrays stored in a list
numpyconcatenation issues you need to pay attention to the shape and dimensions of the arrays. Look at the code for functions likevstackandhstackto understand how they useconcatenate.