So first it asks “Create DataFrame for cat plot using pd.melt
using just the values from ‘cholesterol’, ‘gluc’, ‘smoke’, ‘alco’, ‘active’, and ‘overweight’”, easily done:
# Create DataFrame for cat plot using `pd.melt` using just the values from 'cholesterol', 'gluc', 'smoke', 'alco', 'active', and 'overweight'.
df_cat = pd.melt(df, value_vars=['cholesterol', 'gluc','smoke', 'alco', 'active', 'overweight'])
but then it asks to “Group and reformat the data to split it by ‘cardio’. Show the counts of each feature…”
I don’t even know how to start , since there’s no ‘cardio’ column in df_cat .
Any help with this? For example, how does the resulting frame should look like?