-1

Im trying to find a way to compare what students performed consistantly in their InternalAssessment_Performance to their FinalExam_Performance. Essentially i need to find what students have the same answer in both those columns. How is it possible to compare the values in both commons and have them returned if they are the same? Any help no matter how small would be great.

1 Answers1

0

If the columns are aligned you can do something like this:

df[df['InternalAssessment_Performance'] == df['FinalExam_Performance']]
oppressionslayer
  • 6,942
  • 2
  • 7
  • 24
  • Yes this works perfect thankyou, lets say i needed to compare it to more columns too. Would i simple just add more '=='? – Jwright164 Dec 07 '19 at 21:41
  • yes, add them with parens: like this: df[(df['InternalAssessment_Performance'] == df['FinalExam_Performance']) & ( df['another'] == df['anotherone'])] – oppressionslayer Dec 07 '19 at 22:10