I think this a pretty simple question. I am new to python and I am unable to find the perfect answer.
I have a dataframe :
A B C D E
203704 WkDay 00:00 0.247 2015
203704 WkDay 00:30 0.232 2015
203704 Wkend 00:00 0.102 2015
203704 Wkend 00:30 0.0907 2015
203704 WkDay 00:00 0.28 2016
203704 WkDay 00:30 0.267 2016
203704 Wkend 00:00 0.263 2016
203704 Wkend 00:30 0.252 2016
I need :
A B 00:00 00:30 E
203704 Wkday 0.247 0.232 2015
203704 Wkend 0.102 0.0907 2015
203704 Wkday 0.28 0.267 2016
203704 Wkday 0.263 0.252 2016
I have gone through various links like this and this. However, implementing them I am getting various errors.
I was able to run this successfully
pandas.pivot_table(df,values='D',index='A',columns='C')
but it does not give what exactly I want.
Any help on this would be helpful.