Aggregation range

User 5179 | 6/6/2016, 6:51:11 PM

What is the best way to find the range(max - min) for the group by operations, without first finding the max and the min in distinct columns.

for example: sf.groupby(keycolumns='somecollumn', ... operations={'range': (agg.MAX('col1') - agg.MIN('col1') )}) # This is what I would like to do.

I couldn't find similar question on the forum.

Comments

User 1178 | 6/6/2016, 10:18:38 PM

Hi Demir,

What you have is a good way. I would do similar things as you do!

Thanks!


User 5179 | 6/7/2016, 2:56:58 PM

Ping, :) unfortunately this does not work.

Allowing user defined function with groupby would be nice.