FunctionRacerProblemsRace

Latest Row per Player

EasypandasPython

games has columns player and score, and rows are in the order they were played. Return a DataFrame that keeps only the last row of each player, with the rows in their original order.

Example 1

games {"player":["ann","bob","ann"],"score":[5,7,9]}
returns {"columns":["player","score"],"rows":[["bob",7],["ann",9]]}

Ann's first row is dropped.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More pandas problems