擅长:python、mysql、java
<p>我在pandas文档中:<a href="https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html" rel="nofollow noreferrer">Indexing and selecting data</a>我找到了一种简单易行的方法:</p>
<pre><code>df[['PT011','PT021']]=df[['PT021','PT011']]
df[['PT012','PT022']]=df[['PT022','PT012']]
</code></pre>
<p>按所需顺序输出:</p>
^{pr2}$