Closed cboulay closed 4 months ago
This will take a moment to digest; I haven't considered this pattern for this sort of operation yet -- Possible this "RangedAggregate" function belongs in core, or possibly even in AxisArray? Also thinking some variety on "map" might make a better name that's consistent with similar functionality in functional programming, XArray, and Pandas.
On the provided axis, for each range, slice the data within the range criteria and apply an operator (mean, median, sum).
I'm happy to do this as a PR but I'd like some suggestions for names and settings.
Unit name possibilities:
And for the settings, when defining the ranges, should that be an ordered dictionary with keys corresponding to tick-values/labels along the new axis and values specify the range along the old axis? Or maybe we keep the axis the same and the new tick-values are the mean of the tick-values caught in the slice? The latter seems more straightforward.