For categorical data -Scikit-Learn- provides a so-called one-hot encoder. This is called one-hot encoding, because only one attribute will be equal to 1 (hot), while the others will be 0 (cold). Scikit-Learn provides a OneHotEncoder encoder to convert integer categorical values into one-hot
from sklearn.preprocessing import OneHotEncoder
encoder = OneHotEncoder()