What do pandas shift() and diff() do in time-series analysis?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Asks what the pandas shift() and diff() methods return and how they are used on time-series data. Tests understanding of lags and leads, period-over-period change, and the row order, grouping and missing-date pitfalls that come with them.