จะจัดการกับ SettingWithCopyWarning ใน Pandas ได้อย่างไร?
พื้นหลัง ฉันเพิ่งอัพเกรด Pandas จาก 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 …