擅长:python、mysql、java
<p>根据文档<a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_excel.html" rel="nofollow noreferrer">here</a></p>
<p>要将索引设置为新列,
将索引用作False</p>
<pre><code>df.to_excel(writer, sheet_name='Sheet1_test',index=False)
</code></pre>