SyntaxFix
Write A Post
Hire A Developer
Questions
To easily shift by 5 values for example and also get rid of the NaN rows, without having to keep track of the number of values you shifted by:
d['gdp'] = df['gdp'].shift(-5) df = df.dropna()