Screen Link:
https://app.dataquest.io/m/134/machine-learning-project-walkthrough%3A-preparing-the-features/8/dummy-variables
My Code:
convert_cols = ['home_ownership', 'verification_status', 'purpose', 'term']
dummy = pd.get_dummies(loans[convert_cols])
loans = pd.concat([loans, dummy], axis=1)
loans.drop(columns=convert_cols, inplace=True)
Why we did not have to explicitly convert object into categorical values before generating dummies e.g. [loans[c] = loans[c].astype(‘category’) for c in convert_cols].
If it is implicit - which are usecases to explicitly convert?