I am trying to create a one-hot encoding for target values using the built-in iris dataset with pandas. I have split the data into features and target labels. The target labels are a pandas series (single column). I would like to replace the single values with an array so as to represent the target values as one-hot encoding.
I cannot seem to find a way to do this?
Please help! (https://i.stack.imgur.com/GMRuW.png)
I tried to use the .replace method to replace the floats with arrays
Pandas has the get_dummies() function for doing this