How to Perform One-Hot Encoding in Python - Statology
www.statology.org › one-hot-encoding-in-pythonSep 28, 2021 · How to Perform One-Hot Encoding in Python. One-hot encoding is used to convert categorical variables into a format that can be readily used by machine learning algorithms. The basic idea of one-hot encoding is to create new variables that take on values 0 and 1 to represent the original categorical values. For example, the following image shows how we would perform one-hot encoding to convert a categorical variable that contains team names into new variables that contain only 0 and 1 values: