FunctionRacerProblemsRace

Carry the Last Value

BeginnerpandasPython

readings has columns hour and temp. Some temperatures are missing (None). Replace each missing value with the most recent earlier temperature. The first row is never missing. Return the temperatures as a list.

Example 1

readings {"hour":[1,2,3,4],"temp":[10.0,null,null,13.0]}
returns [10.0,10.0,10.0,13.0]

The two gaps take the value 10.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