AnalystPath

Chess Club Standings

PandasEasyJunior level~10 min

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.

club_records
member_idmember_namegames_playedvictoriesstalematesdefeats
1Nadia10622
2Bram10550
3Ivo10406
4Quincy10622

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_records

Solve 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

Related Pandas questions