Announcing the winners & finalists of the Dataiku Frontrunner Awards 2021! Read their inspiring stories

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
Dataiker
Dataiker

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
Dataiker
Dataiker

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

deepakdhiman
Level 2
Author

Thank you 🙂

0 Kudos
Jurre
Level 3

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

 

A banner prompting to get Dataiku DSS