Feb-20-2019, 05:00 AM
I am not sure I understand you correctly, but
if you want to convert
so these arrays could be stacked using
if you want to convert
[ array([[0,0,0],[0,0,0]]), array([0,0,0]) ]to
array( [0,0,0] [0,0,0] [0,0,0])you can do this using
numpy.vstack
function, e.g.import numpy as np sample_data = [np.random.rand(np.random.randint(2, 4), 3) for s in range(10)] sample_data.append(np.array([5,6,7]))Ok, sample_data consists of arrays of different size with common number of columns
3
, so these arrays could be stacked using
np.vstack
:np.vstack(sample_data)