I have a dataframe such as :
Groups Species Value
G1 SP1 YES
G1 SP2 YES
G1 SP3 NO
G1 SP4 YES
G2 SP1 NO
G2 SP2 NO
G2 SP4 YES
G3 SP1 YES
G3 SP2 YES
G4 SP1 NO
And I would liek simply to pivot the table such as :
Species G1 G2 G3 G4
SP1 YES NO YES NO
SP2 YES NO YES NA
SP3 NO NA NA NA
SP4 YES YES NA NA
So far I tried :
df.pivot(columns='Groups',index='Species',values=Value)
But I get :
ValueError: Index contains duplicate entries, cannot reshape