报错Try using .loc[row_indexer,col_indexer] = value instead

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

    # 用loc 方法来修改值的话不会进行报错, loc[行条件,列名] 进行修改值
    summary.loc[summary['身份证号码']=='****','year']='1974'
    summary.loc[summary['身份证号码'] == '****','month'] = '03'

猜你喜欢

转载自blog.csdn.net/weixin_45631815/article/details/117561878
今日推荐