Example
s=pd.Series([5,4,3,2,1], index=[1,2,3,4,5]) print s 1 5 2 4 3 3 4 2 5 1
Is there an efficient way to create a serie
Here is a cool one liner for lagged features with _lagN suffixes in column names using pd.concat:
_lagN
pd.concat
lagged = pd.concat([s.shift(lag).rename('{}_lag{}'.format(s.name, lag+1)) for lag in range(3)], axis=1).dropna()