FunctionRacerProblemsRace

Average Experience per Project

MediumpandasPython

assignments has columns project and emp (an employee on a project). staff has columns emp and years (years of experience). Return a dictionary mapping each project to the average years of experience of its employees.

Example 1

assignments {"project":["p1","p1","p2"],"emp":[1,2,2]}
staff {"emp":[1,2],"years":[3,5]}
returns {"p1":4.0,"p2":5.0}

p1: (3 + 5) / 2 = 4.0. p2: 5.0.

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