It would be nice if there was a way to specify a minimum window size for calculations in case not enough data is available. For example, a rollmean with windowsize of 3 and minimum window size of 2 would not calculate anything for the first entry of the input array, mean of the first 2 entries of the input array for the second item and mean of 3 entries going forward.
FWIW, Python's Pandas supports this with argument called min_periods: https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.rolling.html
PS: I understand that the philosophy of this package is to keep it simple but to me this feels like something that would more naturally fit here instead of another "layer" package built "on top" of this one.
It would be nice if there was a way to specify a minimum window size for calculations in case not enough data is available. For example, a
rollmean
withwindowsize
of 3 and minimum window size of 2 would not calculate anything for the first entry of the input array, mean of the first 2 entries of the input array for the second item and mean of 3 entries going forward. FWIW, Python's Pandas supports this with argument calledmin_periods
: https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.rolling.htmlPS: I understand that the philosophy of this package is to keep it simple but to me this feels like something that would more naturally fit here instead of another "layer" package built "on top" of this one.