I have a pandas dataframe which has a numerical column "amount". The amount varies from 0 to 20000. I want to change it into categorical variable which defines a range. So, the categorical variable would be :
- Between 0-1000$
- Between 1000-2000$ and so on.. till 19000-20000$
I am unable to figure out how to change the column. I can change it to a binary values like this :
months["value"] = np.where(months['amount']>=450, 'yes', 'no')
But, how to do it for categorical variable having more than 2 values?