Prompt:
"Generate Python code to create lagged features for a time-series dataset."
Output:
data = {'date': pd.date_range(start='2023-01-01', periods=10), 'value': range(10)} df = pd.DataFrame(data) df['lag_1'] = df['value'].shift(1)
df
Output Explanation: A table with an additional column showing the value from the previous row as a lagged feature.