I have a dataset as shown:
student_id course_marks
1234 10
9887 30
9881 20
5634 40
5634 50
1234 60
1234 70
I want to sort them using course_marks, then rank them within their student_id
expected:
student_id course_marks rank
1234 10 1
1234 60 2
1234 70 3
5634 40 1
5634 50 2
9887 20 1
9887 30 2