Exercise

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"]
)

Instructions

50 XP

Possible answers