FunctionRacerProblemsRace

Days Between

EasypandasPython

trips has columns start and end, both dates written like "2024-03-15", with end on or after start. Return a list with the number of days from start to end for each row (0 if they are the same day), as ints.

Example 1

trips {"start":["2024-03-01","2024-05-05"],"end":["2024-03-04","2024-05-05"]}
returns [3,0]

3 days, then 0 days.

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