I have been trying to print a new column in my dataframe that shows all of the courses a faculty is instructing for the month. However, I've only been able to find a way for the code to display one of the courses a faculty is instructing. My attempts to display all of them lead to additional fluff around the course codes. How can I remove the fluff?
for name, group in grouped:
num_students = group['RegStudents'].sum()
num_sections = group['code'].count()
course_code = group['code'].unique() #This displays all of the courses they teach but with fluff
course_code_str = ', '.join(course_code.astype(str)) # my attempt to remove the fluff
......
# This is the output
['Ashley Tisdale',
'ACD', #Faculty Title
'MCBS', # Home program
array(['MCB359', 'MED119'], dtype=object), # Course Codes with fluff
'This faculty is fully utilized.'],