I have a dataframe that contains 2 columns, Class and Name. Here is an example of the data:
Class Name
Physics Anna
Physics Bob
Maths Gary
Biology Anna
Biology Gary
I am trying to join the 'Name' column based on the 'Class' column. The output I am looking for should be:
Class Name
Physics Anna Bob
Maths Gary
Biology Anna Gary
Note, no commas between the names. This is because I will be feeding this output to another system which requires the output to be in this format. Seeking assistance!
Thanks for reading!