[Numpy-discussion] np.dstack vs np.concatenate?

Bradley M. Froehle brad.froehle at gmail.com
Mon Dec 10 17:38:50 EST 2012

The source for np.dstack would point the way towards a simpler

array = np.concatenate(map(np.atleast_3d, (arr1, arr2, arr3, arr4, arr5,
arr6)), axis=2)

array_list_old = [arr1, arr2, arr3, arr4, arr5, arr6]
> array_list = [arr[...,np.newaxis] for arr in array_list_old]
> array = np.concatenate(tuple(array_list),axis=2)
> So is there some inconsistency in the documentation?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20121210/5600ccf4/attachment.html>

More information about the NumPy-Discussion mailing list