One-hot encoding labels
Another little snippet that I sometimes forget 🙂 Suppose you have a dataframe with a column that has data in a string format and you need to transform that into a way that a machine learning algorithm can use. One good way is with one-hot encoding which will take the values in the column and create new columns with 1’s & 0’s representing the original data. Have a look at this dataframe snippet: prod rev Read more


