- API reference
- Testing
- pandas.error...
pandas.errors.SettingWithCopyWarning#
- exceptionpandas.errors.SettingWithCopyWarning[source]#
Warning raised when trying to set on a copied slice from a
DataFrame.The
mode.chained_assignmentneeds to be set to set to ‘warn.’‘Warn’ is the default option. This can happen unintentionally whenchained indexing.For more information on evaluation order,seethe user guide.
For more information on view vs. copy,seethe user guide.
Examples
>>>df=pd.DataFrame({'A':[1,1,1,2,2]},columns=['A'])>>>df.loc[0:3]['A']='a'...# SettingWithCopyWarning: A value is trying to be set on a copy of a...
On this page