One-hot encoding

In the previous exercise, we encountered a dataframe df1 which contained categorical features and therefore, was unsuitable for applying ML algorithms to.

In this exercise, your task is to convert df1 into a format that is suitable for machine learning.

This exercise is part of the course

Feature Engineering for NLP in Python

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Print the features of df1
print(____.____)