如何处理熊猫中的SettingWithCopyWarning?
背景 我刚刚将熊猫从0.11升级到0.13.0rc1。现在,该应用程序弹出了许多新警告。其中之一是这样的: E:\FinReporter\FM_EXT.py:449: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_index,col_indexer] = value instead quote_df['TVol'] = quote_df['TVol']/TVOL_SCALE 我想知道到底是什么意思?我需要改变什么吗? 如果我坚持使用该如何警告quote_df['TVol'] = quote_df['TVol']/TVOL_SCALE? 产生错误的功能 def _decode_stock_quote(list_of_150_stk_str): """decode the webpage and return dataframe""" from cStringIO import StringIO str_of_all = "".join(list_of_150_stk_str) quote_df …