np.vstack is the canonical way to perform this operation:
>>> var=[np.array([ 33.85967782]), np.array([ 34.07298272]), np.array([ 35.06835424])]
>>> np.vstack(var)
array([[ 33.85967782],
[ 34.07298272],
[ 35.06835424]])
If you need an array of forms (n,1), but you have arrays with several elements, you can do the following:
>>> var=[np.array([ 33.85967782]), np.array([ 35.06835424, 39.21316439])]
>>> np.concatenate(var).reshape(-1,1)
array([[ 33.85967782],
[ 35.06835424],
[ 39.21316439]])
source
share