pandas - comparing two columns of different dataframes with multiple strings
You can first pivot on subject column using pd.pivot_table and then do a ofpd.merge on subject columns of student and teacher tables to relate teachers and students based on subjects.
I'm pretty new to pandas and got an assignment asking me to compare & match two columns of 2 different .csv files. 
dtypes are strings
1st df
Name     | Subjects 
Student1 | Biology, Math, German
Student2 | Sport, Biology, English
Student3 | Chemistry, Math, Biology
2nd df
Name     | Subjects
Teacher1 | Biology, Sport, English
Teacher2 | Chemistry, Math, Physics
Teacher3 | Biology, Physics, Chemistry, English
...
Now, I should compare and find the best match between a Student & Teacher. 
Meaning, they should match at least 1 subject, but for a "perfect match" all of them.
I tried different things already - pd.merge, iterrows, isin, etc. - but can't find a great performant solution.
I'm not asking for a solution for my assignment, but for a small push in the right direction.
Thank you!