擅长:python、mysql、java
<p>看看<a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.transpose.html" rel="nofollow noreferrer">numpy.transpose</a></p>
<blockquote>
<p>Use transpose(a, argsort(axes)) to invert the transposition of tensors
when using the axes keyword argument.</p>
<p>Transposing a 1-D array returns an unchanged view of the original
array. </p>
</blockquote>
<hr/>
<p>例如</p>
<pre><code>>>> x = np.arange(4).reshape((2,2))
>>> x
array([[0, 1],
[2, 3]])
>>>
>>> np.transpose(x)
array([[0, 2],
[1, 3]])
</code></pre>