I have a pandas dataframe like this
snapDate instance waitEvent AvgWaitInMs
0 2015-Jul-03 XX gc cr block 3-way 1
1 2015-Jun-29 YY gc current block 3-way 2
2 2015-Jul-03 YY gc current block 3-way 1
3 2015-Jun-29 XX gc current block 3-way 2
4 2015-Jul-01 XX gc current block 3-way 2
5 2015-Jul-01 YY gc current block 3-way 2
6 2015-Jul-03 XX gc current block 3-way 2
7 2015-Jul-03 YY log file sync 9
8 2015-Jun-29 XX log file sync 8
9 2015-Jul-03 XX log file sync 8
10 2015-Jul-01 XX log file sync 8
11 2015-Jul-01 YY log file sync 9
12 2015-Jun-29 YY log file sync 8
I need to transform this to
snapDate instance gc cr block 3-way gc current block 3-way log file sync
2015-Jul-03 XX 1 Na 8
2015-Jun-29 YY Na 2 8
2015-Jul-03 YY Na 1 9
...
I tried pivot but it returns an error dfWaits.pivot(index = 'snapDate', columns = 'waitEvent', values = 'AvgWaitInMs') Index contains duplicate entries, cannot reshape
The result should be another dataFrame