1# Dataframe:
2# Class math score reading score writing score
3# Class 1 65 73 74
4# Class 2 69 66 64
5
6df.loc['Difference'] = df.apply(lambda x: x["Class 1"] - x["Class 2"])
7
8# Result:
9# Class math score reading score writing score
10# Class 1 65 73 74
11# Class 2 69 66 64
12# Difference -3 7 10