
Ultimate access to all questions.
Given a dataset with a categorical feature 'Color' having values 'Red', 'Blue', 'Green', and missing values, write a code snippet to perform one-hot encoding on this feature using Python and the pandas library. Explain how this process handles missing values.
A
df = pd.get_dummies(df, columns=['Color'], dummy_na=True)
B
df = pd.get_dummies(df, columns=['Color'], dummy_na=False)
C
df = pd.get_dummies(df, columns=['Color'], drop_first=True)
D
df = pd.get_dummies(df, columns=['Color'], drop_first=False)