解决:SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame.问题

在运行下面代码时,出现了警告: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

出现警告:

解决方法时,我们先将副本复制一份再进行操作:

你可能感兴趣的:(Machine,Learning)