I am working using python and pandas with the dataset below
| Name | Subject | Grade |
|---|---|---|
| Alex | Science | A |
| Bob | Maths | B |
| Bob | Maths | C |
| Cynthia | Science | C |
| Dylan | Geography | A |
| Dylan | Geography | A |
I would like to find names and subjects that have been repeated twice and display them exactly like the table below. The grades will only get concatenated by a comma if required.
| Name | Subject | Grade |
|---|---|---|
| Bob | Maths | B,C |
| Dylan | Geography | A |
Any help would be greatly appreciated