Skip to content
Advertisement

Is it possible to do “rolling mean” first and then “groupby sum” in ONE GO?

For below given working codes , is it possible to compute rolling mean first and then do groupby sum in ONE GO ? I don’t want to create calculated columns in df2 as it is resulting in lots of additional columns for each value in “Mean-1 input Value”

JavaScript

Suggestion given is working fine for one input value , want to compute it for another input value. Working code for 2 input value as given below. Request to guide.

JavaScript

Advertisement

Answer

I think yes, use:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement