Chess Club Standings
Problem
You are given a DataFrame `club_records` loaded from `club_records.csv` with columns `member_id` (int), `member_name` (string), `games_played` (int), `victories` (int), `stalemates` (int) and `defeats` (int). Compute each member's `score` = victories*3 + stalemates, and `standing` = the competition rank by `score` descending (ties share the lowest rank and the next rank is skipped). Return columns `member_id`, `member_name`, `score`, `standing`, sorted by `score` descending then `member_name` ascending.
Input data
Example rows — the live problem includes the full dataset.
| member_id | member_name | games_played | victories | stalemates | defeats |
|---|---|---|---|---|---|
| 1 | Nadia | 10 | 6 | 2 | 2 |
| 2 | Bram | 10 | 5 | 5 | 0 |
| 3 | Ivo | 10 | 4 | 0 | 6 |
| 4 | Quincy | 10 | 6 | 2 | 2 |
Expected output
Your answer should return 4 rows with the columns member_id, member_name, score, standing.
Starter code (Pandas (Python))
import pandas as pd
def club_standings(club_records) -> pd.DataFrame:
# Your code here
return club_recordsSolve this Pandas question free
Write Pandas (Python) and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock