I have a dataframe, that looks like:
Question | Answer |
---|---|
1 | Category1 |
1 | Category1 |
1 | Not Important |
2 | Category2 |
2 | Category2 |
2 | Very Important |
My goal is to create another column ‘Category’ in the dataframe which fetches the value of the category from the answer column
The resulting dataframe:
Question | Answer | Category |
---|---|---|
1 | Category1 | Category1 |
1 | Category1 | Category1 |
1 | Not Important | Category1 |
2 | Category2 | Category2 |
2 | Category2 | Category2 |
2 | Very Important | Category2 |