Esports Ladder Standings by Split
Problem
A competitive gaming league hands you a DataFrame `split_results`, one row per roster's end-of-split record. A win is worth 3 ladder points and a draw is worth 1; losses are worth 0. Rank rosters within each split by, in order: ladder points (highest first), then round_diff = rounds_won minus rounds_lost (highest first), then roster_name alphabetically. Use a ranking that gives tied rows the same standing (so the next standing skips the gap). Return a DataFrame with columns split_id, roster_id, roster_name, victories, stalemates, defeats, rounds_won, rounds_lost and standing, ordered by split_id, then standing, then roster_name.
Input data
Example rows — the live problem includes the full dataset.
| split_id | roster_id | roster_name | games_played | victories | stalemates | defeats | rounds_won | rounds_lost |
|---|---|---|---|---|---|---|---|---|
| 2021 | 1 | Nova Surge | 38 | 29 | 6 | 3 | 99 | 26 |
| 2021 | 2 | Iron Wolves | 38 | 28 | 8 | 2 | 94 | 26 |
| 2021 | 3 | Crimson Edge | 38 | 21 | 11 | 6 | 76 | 33 |
| 2021 | 4 | Tidal Kings | 38 | 22 | 5 | 11 | 69 | 40 |
| 2021 | 5 | Apex Falcons | 38 | 22 | 3 | 13 | 61 | 48 |
Expected output
Your answer should return 10 rows with the columns split_id, roster_id, roster_name, victories, stalemates, defeats, rounds_won, rounds_lost, standing.
Starter code (Pandas (Python))
import pandas as pd
def esports_ladder_standings_by_split(split_results) -> pd.DataFrame:
# Your code here
return split_resultsSolve 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