[Python] To Rename/categorized the values that have same meaning on column

PHOTO EMBED

Tue Jul 26 2022 11:29:23 GMT+0000 (Coordinated Universal Time)

Saved by @sharfandc #python

df.loc[df['PreferredPaymentMode'] == 'COD', 'PreferredPaymentMode' ] = 'Cash on Delivery'
content_copyCOPY

locate the value in the column that want to be renamed and choose what new name that will changed it or to categorized it (in the same column)

https://www.kaggle.com/code/surendra01/churn-prediction?cellIds=28&kernelSessionId=95592215