Latest Record per Key in pandas

medium
Unit 11 · Pandas IV0/3 to milestone

A change-log DataFrame has columns id, updated_at (ISO timestamps as strings) and status. Implement latest(df) returning one row per id: the one with the latest updated_at (if two rows tie, keep the one that appears later in the input). Return columns id, updated_at, status sorted by id, with a fresh 0-based index.

#pandas#deduplication2 visible + 1 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Latest Record per Key in pandas · TechGradify