[英]Spliting a 3D numpy array on desired axis
I have a NumPy array of shape (4809, 200, 31) and i want to extract following array out of it : shape (4809, 200, 1).我有一个形状为 (4809, 200, 31) 的 NumPy 数组,我想从中提取以下数组:形状 (4809, 200, 1)。 so I want to extract one column from axis=2 from the source array which will have three-axis (0,1,2).
所以我想从具有三轴(0,1,2)的源数组中从axis = 2中提取一列。
Its as simple as doing它就像做一样简单
A[:,:,0:1]. A[:,:,0:1]。 Thanks @Mark for the answer.
感谢@Mark 的回答。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.