numpy 中最新的版本已经删除了这个函数 np.stack,但是可以用其他函数代替:
stack() Join a sequence of arrays along a new axis.
hstack() Stack arrays in sequence horizontally (column wise).
dstack() Stack arrays in sequence depth wise (along third dimension).
concatenate() Join a sequence of arrays along an existing axis.
np.stack((a,b),axis = 2) ---------np.dstack((a,b))
np.stack((a,b),axis = 1) ---------np.hatack((a,b))
np.stack((a,b),axis = 0) ---------np.vatack((a,b))
随着Numpy更新,np.stack已被移除。本文介绍如何使用stack(), hstack(), dstack()及concatenate()等函数作为替代方案。通过具体示例展示不同函数的应用场景。
1593

被折叠的 条评论
为什么被折叠?



