FunctionRacerProblemsRace

Drop Duplicate Pairs

BeginnerpandasPython

visits has columns user, page and seconds. Two rows are duplicates if they have the same user and the same page. Keep only the first row of each pair and return the DataFrame with all three columns, in the original order.

Example 1

visits {"user":["a","a","a"],"page":["home","home","cart"],"seconds":[5,9,3]}
returns {"columns":["user","page","seconds"],"rows":[["a","home",5],["a","cart",3]]}

The second row repeats (a, home).

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