0

i have got some dataset with column that is consist of only numeric variables and new column which i have to fill with categorical data that is connected with this variables ,let's name this column just "new_data"

0      12.6
1       6.9
2      24.6
3      10.9
4      27.8

How I can transform it to categorical (for ex. if data[i]<=17 then new_data[i]="low",if data[i]>17 and data[i]<24 then new_data[i]="average" and if data[i]>24 then new_data[i]="high") with the help of special functions from sklearn or pandas without using loops. thank you

0 Answers0