How to find unique occurance of a value based an another value using pandas?
Assuming that you want to return students who only took one class, You can use groupby and filter:

df.groupby('Student_code', as_index=False).filter(lambda x: x['Subject'].count() ==1 )

  Student_code    Subject
3          124      Maths
4          125  Chemistry