I have this dataframe:
Column A | Column B | Column C | Column D |
---|---|---|---|
1 | value 1 | value 2 | value 3 |
2 | value 4 | value 5 | value 6 |
3 | value 7 | value 8 | value 9 |
I want to create an indicator column and a value column which will make the df look like this:
Column A | Indicator | Value |
---|---|---|
1 | descriptionB | value 1 |
1 | descriptionC | value 2 |
1 | descriptionD | value 3 |
2 | descriptionB | value 4 |
2 | descriptionC | value 5 |
2 | descriptionD | value 6 |
3 | descirptionB | value 7 |
3 | descriptionC | value 8 |
3 | descriptionD | value 9 |
How do I make it happen?
Thank you.
I tried some for loops but so far no luck
New contributor
Elena Iurco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.