I have a dataframe like this:
l1 = ['a','b','c','d','a','b','c','d','e','f']
l2 = ['a1','b1','c1','d1','a1','b1','c1','d1','e1','f1']
l3 = ['a2','b2','c2','d2','a2','b2','c2','d2','e2','f2']
l4 = [1,2,3,4,5,6,7,8,9,10]
df = pd.DataFrame({'Col1':l1,'Col2':l2,'Col3':l3,'Col4':l4})
I am trying to pivot the dataframe using pivot_table() but its aggregating to mean and returning only single row per index.
pd.pivot_table(df,columns='Col3',values='Col4',index=['Col1','Col2'])
I want to display all the rows grouped by index without aggregation. So, the output has repeated index.
Can anynoe help me withthis?