Created
March 15, 2021 22:13
-
-
Save bkaankuguoglu/628fa82d3e806f541301ecdab4c9ec5b 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
def generate_time_lags(df, n_lags): | |
df_n = df.copy() | |
for n in range(1, n_lags + 1): | |
df_n[f"lag{n}"] = df_n["value"].shift(n) | |
df_n = df_n.iloc[n_lags:] | |
return df_n | |
input_dim = 100 | |
df_generated = generate_time_lags(df, input_dim) | |
df_generated |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment