I have a multiple column dataframe and want to separate data in a particular column by grouping them based on another column.
Here is an example:
ID Name Score
1 John 100
2 Lisa 80
3 David 75
4 Lisa 92
5 John 89
6 Lisa 72
I would like my output to be like:
index John Lisa David
0 100 80 75
1 89 92 NaN
2 NaN 72 NaN
I understand I can easily use the code:
df[df['Name'] == 'John]]
and separate all the scores that John has in the dataframe, but since my dataframe is very large I would like to have a clean output like what I showed here.