How to create a categorical column from numerical column

Solved!
deepakdhiman
Level 2
How to create a categorical column from numerical column

I have a numerical column "median_income" with values ranging from 0.49(min) to 15.0(max) with more than 20000 records.

I want to create a categorical columns with 6 categories for different ranges i.e.

- for median_income < 1.5, label 1,

- for 1.5 < median_income < 3.0, label 2

and so on.

what are different ways in Dataiku by which I can accomplish this?

Thanks

0 Kudos
1 Solution
FlorentD
Developer Advocate

Just use prepare recipe with the formula :

if(median_income < 1.5, "label 1",

if(median_income < 3.0, "label 2", "label3"

))

 

View solution in original post

3 Replies
FlorentD
Developer Advocate

Just use prepare recipe with the formula :

if(median_income < 1.5, "label 1",

if(median_income < 3.0, "label 2", "label3"

))

 

deepakdhiman
Level 2
Author

Thank you ๐Ÿ™‚

0 Kudos
Jurre
Level 5

Hi @deepakdhiman ,

Welcome to the community! 

some reference material to what @FlorentD mentioned : 

Formula-language : https://doc.dataiku.com/dss/latest/formula/index.html

The Academy has some nice courses about data preparation : https://academy.dataiku.com/page/advanced-data-preparation