- Published on
- · Data Independent
Pandas Get Dummies | pd.get_dummies()
This post is auto-generated from a public YouTube video for personal study notes. It is not an endorsement. The transcript is machine-derived and may contain errors; refer to the original video for accuracy.
About this video
When you're doing machine learning you'll work with algorithms that cannot process categorical variables.
In this case, you need to turn your column of labels (Ex: ['cat', 'dog', 'bird', 'cat']) into separate columns of 0s and 1s. This is called getting dummies pandas columns.
Pandas pd.get_dummies() will turn your categorical column (column of labels) into indicator columns (columns of 0s and 1s).
This function is heavily used within machine learning algorithms. For instance, random forrest doesn't do great with columns that have labels. It's best to turn these into dummy indicator columns.