When you need to create a lagged feature in a time series dataset in Pandas, which function would you use?

  • delay()
  • diff()
  • lag()
  • shift()
The shift() function in Pandas is used to create lagged features in a time series dataset. It shifts the values of a column by a specified number of periods, allowing you to create lagged versions of the original data for time series analysis.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *