FunctionRacerProblemsRace

Fill the Holes

Easyscikit-learnPython

Some cells of the table df are missing. Return its values with every missing cell replaced by the mean of the cells that are present in its column.

Example 1

df {"a":[1,null,3],"b":[10,20,null]}
returns [[1.0,10.0],[2.0,20.0],[3.0,15.0]]

Column a is missing its middle value: the mean of 1 and 3 is 2. Column b gets the mean of 10 and 20.

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 scikit-learn problems