How can I transform this dataframe...
name | group
James | 1
Mike | 2
Tod | 1
Rico | 2
Billie | 3
Mike | 3
Tod | 2
To this:
name | in_group_1 | in_group_2 | in_group_3
James | True | False | True
Mike | False | True | True
Tod | True | True | False
Rico | False | True | False
Billie | False | False | True
In the first dataframe, it is a combination of all people with each group. In the second dataframe, we combine rows with the same name and tag their group as True base on their groups on the first dataframe. We will also drop the group column after.