SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame See the

SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy

之前对CSV文件做处理跳出这个警告,经过搜索发现只要添上一行代码即可解决如上问题

pd.set_option('mode.chained_assignment', None)

 

你可能感兴趣的:(个人小记)