Feb-19-2020, 06:25 PM
I want to replace NAN value of Product_price column using fillna Mean based on product ID how I can implement. Is it possible I cant implement for all columns in my dataset based on Product_id
data['product_id'] = data.groupby('product_id').product_price.transform(lambda x: x.fillna(x.mean()))
data['product_id'] = data.groupby('product_id').product_price.transform(lambda x: x.fillna(x.mean()))