擅长:python、mysql、java
<p>根据您是否希望保持第四维:</p>
<pre class="lang-py prettyprint-override"><code>In [1]: import numpy as np
In [2]: a = np.random.rand(147, 120, 120, 3)
In [3]: b = a[:, :, :, 0].copy(); b.shape
Out[3]: (147, 120, 120)
# axis=-1 expands the last dimension
In [4]: b = np.expand_dims(a[:, :, :, 0], axis=-1); b.shape
Out[4]: (147, 120, 120, 1)
</code></pre>