Time per Employee
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
- The tables are small
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More pandas problems
- Triangle JudgementEasy
- Weekday CountsEasy
- Weighted GradeEasy
- Words per RowEasy
- Above Department AverageMedium
- Above the Middle EverywhereMedium
- Average Experience per ProjectMedium
- Back the Next DayMedium