So I have health data which I am analysing and I want to add a new column which categorises BMI into underweight, normal weight, and overweight. Below is a sample if the data. The BMI variable is a column.
bmi
21.9671
34.9279
23.507
17.679
43.678
what I would like is to make a column called rating which will take values of bmi <= 18.5 and give a rating of underweight, if the bmi is between 18.5 and 25 then rating should be normal weight otherwise rating will be overweight. What I want the rating column to look like according to the bmi given above is given below.
rating
normal weight
overweight'
normal weight
underweight
overweight.
I tried an if statement but it only takes the first row and applies to the rest of the columns. SO it will give that all BMIs belong in the category "normal weight"
I would really appreciate the help