In this section, we will use scikit-learn to generate one-hot encoding for a small dataset. You can find the code at this GitHub link:
https://github.com/jalajthanaki/NLPython/tree/master/ch5/onehotencodingdemo.
You can see the code snippet in Figure 5.63:
You can see the output in Figure 5.64: