FunctionRacerProblemsRace

Time per Employee

EasypandasPython

entries has columns emp (text), arrive and leave (whole minutes, leave is after arrive). An employee can have several rows. Return a dictionary mapping each employee to the total minutes between arriving and leaving over all their rows.

Example 1

entries {"emp":["e1","e2","e1"],"arrive":[10,5,60],"leave":[30,8,100]}
returns {"e1":60,"e2":3}

e1: 20 + 40 = 60. e2: 3.

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