首页 > 其他 > 详细

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

时间:2021-03-08 14:19:19      阅读:24      评论:0      收藏:0      [点我收藏+]

pandas df:

 

new_df[‘tissue‘] = new_df[‘tissue‘].str.lower()
<ipython-input-24-d2fb04c89c2a>:1: 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

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  new_df[‘tissue‘] = new_df[‘tissue‘].str.lower()

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

原文:https://www.cnblogs.com/emanlee/p/14497914.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!