0

我收到以下错误:

---------------------------
Error
---------------------------
\\path\Main.py:157: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
  linked_performance['GICS Ind Weight'] = 100*linked_performance['Average % Weight Port']/linked_performance['Average % Weight Port'].sum()
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "\\path\Main.py", line 174, in main
    wb.save('\\path\current_report.xlsx')
  File "C:\Users\user\AppData\Local\Continuum\Anaconda\lib\site-packages\xlwings\main.py", line 287, in save
    xlplatform.save_workbook(self.xl_workbook, path)
  File "C:\Users\user\AppData\Local\Continuum\Anaconda\lib\site-pack
---------------------------
OK   
---------------------------

像 174 这样的地方是:

wb.save('\\path\current_report.xlsx')

如果我不保存,我不会收到错误消息。

这里有什么想法吗?

4

0 回答 0