How can I convert a pandas pivot table to a regular dataframe ? For example:
amount
categories A B C
date deposit
2017-01-15 6220140.00 5614354.16 0.00 0.00
2017-01-16 7384354.00 6247300.22 0.00 0.00
2017-01-17 6783939.00 10630021.37 0.00 0.00
2017-01-18 67940.00 4659384.47 0.00 0.00
to a regular datetime such as this:
date deposit A B C
0 2017-01-15 6220140.00 5614354.16 0.00 0.00
1 2017-01-16 7384354.00 6247300.22 0.00 0.00
2 2017-01-17 6783939.00 10630021.37 0.00 0.00
3 2017-01-18 67940.00 4659384.47 0.00 0.00
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…