正确写法

con_data.loc[con_data.product_inner_type == 'XJB' , 'M_class' ] = 'gongmu'

不报错但是没有效果的写法,如下两种:

1 con_data[con_data.product_inner_type == 'XJB'][ ' M_class ' ] = '1'

2 con_data[con_data.product_inner_type == 'XJB'].loc[ ' M_class ' ] = '1'

 

相关文章: