Biggest Daily Jump
prices has columns day and price (whole numbers), with at least two rows. Return the largest value of "this row's price minus the previous row's price" as an int. It can be negative if the price only falls.
Example 1
prices {"day":[1,2,3],"price":[10,15,12]}
returns 5
Changes are +5 and -3; the biggest is 5.
Constraints
- At least two rows
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More pandas problems
- Cap the SalariesBeginner
- Carry the Last ValueBeginner
- Colour TallyBeginner
- Column StatisticsBeginner
- Column TotalBeginner
- Correlation of ColumnsBeginner
- Count Missing ValuesBeginner
- Count Repeated RowsBeginner