Given a DataFrame with columns ["user_id", "date", "value"] sorted by user and date, write code to add per-user rolling 7-day mean, rolling 7-day std, and a 1-day lag of "value". Do not leak future data into past rows.
Sign in to see what a strong answer covers and to get AI feedback on your own.