-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG/ENH: Add how kwarg to rolling_* functions [fix #6297] #6845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
median should also have a how=median I think pls add a similar test for min/ median as well the docs in computation.rst might need a bit of tweaking as well |
Updated to include median, additional tests, and added documentation in computation.rst |
can u add a note near the how that u updated in computation.rst to explain when the how is used (eg only in intra day resample a when the moment freq is > day) |
Expressing a concern: I don't know if I find this a very good idea. Some things that worry me:
But it's maybe just a stupid feeling, and you can certainly convince me that this is a good idea. Even now writing it down my hesitation is already not that strong anymore :-) |
Hmm, thinking more thoroughly about it, with some use case in my head. If you have an irregular timeseries, it is indeed resampling it to a regular timeseries what you want, otherwise the rolling function does not make much sense. My idea of specifying the window as a frequency when not having a regular timeseries is also not really well defined what this should do, without first resampling it. Concern of breaking backwards compatibility still holds, but maybe not too many people will rely on this? (for min/max/median) It is also not really possible to do this with a deprecation warning I think. |
|
||
- ``how``: optionally specify method for down or re-sampling. Default is | ||
is min for ``rolling_min``, max for ``rolling_max``, median for ``rolling_median``, | ||
and mean for all other rolling functions. See :meth:`DataFrame.resample`'s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some spaces are missing at the beginning of the line to align this with the previous lines.
Added some comments on the docs. For the release notes. I think there should also be a mention in the API changes section? (for the change of the default for min/max/median) |
@jorisvandenbossche I think this actually a bug (but can put in the API section) only affects max,min,median |
@jreback Yeah, I agree after some better thinking that is normally (in most cases) not what you want, it's just that is was documented. So in that sense certainly an api change. But you can forget my concerns :-) |
@jsexauer can you rebase on master; looks fine otherwise ping when ready |
Yes, I am OK with this, just my two formatting comments of above. |
@jreback Ready for merging. |
ok...ping when green |
It is green...? |
BUG/ENH: Add how kwarg to rolling_* functions [fix #6297]
thanks! |
Fixes #6297
Figured while I was in the area, would submit a PR to do this too. Let me know if you want to see more unit tests than the one.