Created
May 3, 2020 08:23
-
-
Save anbento0490/7468e1c997136fcb7fb41e28f1d6e97d 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
stocks['Lag1 pct'] = stocks.groupby('Symbol')['Adj Close'].pct_change(-1).round(2) | |
stocks['Lag7 pct'] = stocks.groupby('Symbol')['Adj Close'].pct_change(-7).round(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment