Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

lag function in pandas

df['Data_lagged'] = df.groupby(['Group'])['Data'].shift(1)
 
PREVIOUS NEXT
Tagged: #lag #function #pandas
ADD COMMENT
Topic
Name
5+4 =