I'd like to create new columns in my dataframe using unique values from another column, for example
Column 1 has the following values:
Apple
Apple
Banana
Strawberry
Strawberry
Strawberry
When I check unique values in Column 1, the output would be :
Apple
Banana
Strawberry
Now I want to use these three values to create columns named "Apple","Banana","Strawberry" and I want to keep the code dynamic to adapt to however number of unique values are present in Column 1
I'm new to python, any help will be appreciated!
So far, I've been doing getting that output by manually creating new columns in the dataset, I need this to happen automatically depending on the unique values in Column 1