擅长:python、mysql、java
<p>您可以这样尝试:</p>
<pre><code>df.set_index(df['index'], inplace=True)
</code></pre>
<p>这会将<code>index</code>列设置为数据帧中的索引,并且<code>index</code>列也会保留在数据帧中。然后,你就可以放下那一栏。你知道吗</p>
<pre><code>df.drop('index', axis=1, inplace=True)
</code></pre>