pandas : sum with lagged param
in sql request, i have a chance to sum with lagged param on the fly, like: CASE WHEN dt_rep.fcr = 0::numeric THEN 0::numeric ELSE (dt_rep.fcr – lag(dt_rep.fcr) OVER (PARTITION BY dt_rep.place_id ORDER BY dt_rep.bucket)) / dt_rep.fcr END AS cr here, I order the table by bucket (it is timeframe) and sorted them by place_id (to… Read More pandas : sum with lagged param