One-hot knowledge check
A frequency table from a categorical pandas Series for a person's favorite soda is shown.
Coke 1221
Pepsi 1117
NaN 21
If one-hot encoding is completed only on this column, and this is the only column in the dataset, how many columns will be in the final dataset?
Example code:
soda_onehot = pd.get_dummies(
soda[["favorite_soda"]],
columns=["favorite_soda"]
)
Diese Übung ist Teil des Kurses
Working with Categorical Data in Python
Interaktive Übung
In dieser interaktiven Übung kannst du die Theorie in die Praxis umsetzen.
