Return sales shifted down by one row — each row holding the previous day's value

pandas · from shift, diff and change over time

.shift().diff().pct_change()grouped shiftleakagecumsum

Putting the kettle on…

Starting up…

Exercise 1

Return sales shifted down by one row — each row holding the previous day's value.

your answer
stuck? the lesson behind it
shift, diff and change over time
Slide the column down a row, and every “compared to last time” question falls out.