I have a dataframe like this
Input
student_id rep
abc100 1
abc101 2
abc102 1
abc103 2
abc104 1
abc105 2
abc106 1
abc107 2
Expected output
1 2
abc100 abc101
abc102 abc103
abc104 abc105
abc106 abc107
I tried
df = df.pivot( columns='rep', values='student_id')
but it contains lot of nans and didnt give expected output.
I searched in stackoverflow but couldnt find an answer.