This question evaluates proficiency in data cleaning and transformation for Data Science, focusing on handling missing values, median imputation, and ranking/sorting logic using SQL or Python (Pandas).
Implement a Python function to clean and rank student scores.
You are given a table (or DataFrame) students with schema:
| column | type | notes |
|---|---|---|
| student_id | int | unique identifier |
| math_score | float | may be null |
| english_score | float | may be null |
| physics_score | float | may be null |
Write a function (e.g., select_top_students(students_df) -> pd.DataFrame) that:
math_score
descending, then
physics_score
descending
student_id
ascending.
None
/
NaN
.