I have following data,
Unnamed: 5 | Week | Value |
---|---|---|
Quartiles | Week5 | 3 |
CR | Week4 | 2 |
KPI | Week3 | 1 |
Quartiles | Week5 | 2 |
CR | Week4 | 5 |
KPI | Week3 | 1 |
I am trying to convert like this
Week | Quartiles | CR | KPI |
---|---|---|---|
Week5 | 3 | 2 | 2 |
Week4 | 2 | 5 | 5 |
Week3 | 1 | 1 | 4 |
While running the following code:
df3 = pd.pivot_table(df2,values='value',index='variable',columns='Unnamed: 5',aggfunc='first')
I got following error,
"Index contains duplicate entries, cannot reshape"
I tried different agg function nothing works..
I dont need agg function, I just need to update values as it is...