pandas · Lesson 10.1 · Pro

shift, diff and pct_change

Compare each row with the one before it: day-over-day changes, growth rates and gaps between events.

In this lesson

  1. The previous row with shift
  2. Changes with diff and pct_change
  3. shift inside each group
  4. Looking ahead