Created
August 3, 2021 09:08
-
-
Save BexTuychiev/b64c8af85c9335bea0d533ac523e2b6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
time_series = tips[["tip"]] | |
time_series["lag_1"] = time_series["tip"].shift(1) | |
time_series["lag_2"] = time_series["tip"].shift(2) | |
time_series["lag_3"] = time_series["tip"].shift(3) | |
time_series["lag_4"] = time_series["tip"].shift(4) | |
# time_series['lag_k'] = time_series['tip'].shift(k) | |
>>> time_series.head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment