Not sure if I am causing issues posting my questions repeatedly; all I need is help. Let me know if posting topics (seeking assistance) also affects marking of assignments and in turn of Certification completion.
Working on the Medical Data Visualizer; can someone tell me I am doing something seriously wrong… or?
Add an ‘overweight’ column to the data. To determine if a person is overweight, first calculate their BMI by dividing their weight in kilograms by the square of their height in meters. If that value is > 25 then the person is overweight. Use the value 0 for NOT overweight and the value 1 for overweight.
Normalize data by making 0 always good and 1 always bad. If the value of ‘cholesterol’ or ‘gluc’ is 1, make the value 0. If the value is more than 1, make the value 1.
My code below to start with; is this correct? How do I check both the things viz. BMI value is > 25 and user overweight 0 or 1 ?
Your help is much appreciated. Thank you in advance.
df[‘overweight’] = df[df[‘weight’] / (df[‘height’]) ** 2]