It seems a basic pivot operation. I want to do it in python pandas. My dataset looks like:
Date weekno no_visitors_store1 no_visitors_store2 no_visitors_store3
2015/01/01 1 45 34 46
2015/01/02 1 40 32 100
2015/01/03 1 45 30 46
2015/01/04 1 45 11 10
I want to pivot in such a way so that I want to transpose only last three columns so that I can have store as a column and their coreesponding numbers.
Date weekno store no_of_vistors
2015/01/01 1 store1 45
2015/01/01 1 store2 34
2015/01/01 1 store3 46
2015/01/02 1 store1 40
2015/01/02 1 store2 32
2015/01/02 1 store3 100
There is a stack option to the do the above task. But not sure how to use it.