Skip to content

Glossary: pandas Beyond the Basics

shift

Also written: .shift()

Moves every value down by a number of rows so each row sees an earlier one. The first rows become NaN, and it counts rows, not months.

Where the book teaches it

Related terms

diffpct_change