Tags / shift
Modifying Serial Numbers in Pandas DataFrames Using .loc and shift()
Assigning Timespans to Individuals in Batches Using Pandas and Python
Shifting Non-Nan Values in Multiple Columns Row-Wise by Group with Pandas
Using Pandas to Analyze Last N Rows: 2 Efficient Approaches to Create a New Column Based on Specific Values