the dataframe is as follows:
sname | sid | sno | spercentage | student_id
---------------------------------------------
A 234 1 76.45 1
B 567 8 87.47 8
C 890 6 91.32 5
D 456 4 65.58 4
the goal is to get the count of students that have percentage below or equal to 100, below or equal to 90, below or equal to 80, below or equal to 70, below or equal to 60 and below or equal to 50. And another condition if two columns matched or not.
the desired output:
percentage (<=) | s_count | sid_count
--------------------------------------
100 4 3
90 3 3
80 2 2
70 1 1
60 0 0
50 0 0
Could anyone please help me with this? Thank you