因為絕對路徑沒有加轉義符,\前加上\即可
因為在寫代碼的時候用了空格和tab混合,容易發生在控制流語句中,要統一使用tab即可。
-
./pandas_test.py:16: FutureWarning: As the xlwt package is no longer maintained, the xlwt engine will be removed in a future version of pandas. This is the only engine in pandas that supports writing in the xls format. Install openpyxl and write to an xlsx file instead. You can set the option io.excel.xls.writer to 'xlwt' to silence this warning. While this option is deprecated and will also raise a warning, it can be globally set and the warning suppressed.
-
data.to_excel('1.xls')
翻譯:由於xlwt軟件包不再維護,xlwt引擎將在未來版本的pandas中刪除。這是pandas中唯一支持xls格式寫入的引擎。安裝openpyxl並改為寫入xlsx文件。您可以設置選項io.excel.xls文件。寫入“xlwt”以消除此警告。雖然此選項已棄用,並且還會引發警告,但可以全局設置它並抑制警告
這是警告 其實已經輸出了xls文件
