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

Bradley M. Froehle brad.froehle@gmail....
Mon Dec 10 16:38:50 CST 2012


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

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?
>

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


More information about the NumPy-Discussion mailing list