I'm thinking to convert multiple columns of categorical variables in a data frame to dummy variables using pandas. The code below works, but it seems too long. May I know how do I combine these 3 lines in a single line of code, please? Thank you
X = pd.get_dummies(df.height, prefix=['height'])
Y = pd.get_dummies(df.weight, prefix=['weight'])
Z = pd.get_dummies(df.age, prefix=['age'])**