-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Add time-length windowing capability to moving statistics #936
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
Comments
If I understand this right, it's similar to what I'm asking here: http://stackoverflow.com/questions/14300768/pandas-rolling-computation-with-window-based-on-values-instead-of-counts . I think the facility should not be time-specific. You should be able to use windows of any value range on any sort of values, not just time values. |
Thanks for sharing! |
@jreback - cookbook. |
in cookbook...closing |
When rolling_mean was found in stats.moments, it is naturally assumed time is weighted, otherwise it should appear in stats instead. However I found it is not weighted.
The above experiment demonstrated that rolling_mean disregard the 10 missing days in TS2, and calculate as if the data is evenly sampled, that is, as if it is not Time Series. I am afraid users are not expecting this behaviour. I believe this problem is integral to the feature asked here. If time is properly weighted in the calculation, there is no reason why window canot be specified with a time-frame. Solving the asked feature also solves this unwanted behaviour. |
in cookbook...closing --> IN which chapter of the cookbook? Looked, not found. (it is not searchable and Google search with rolling_mean as keyword only yeild results outside of the cookbook: if what you meant of cookbook is this one: http://pandas.pydata.org/pandas-docs/stable/cookbook.html |
Oh I see, what is added to the cookbook is a link from cookbook to stackoverflow, that's why "Google search with rolling_mean as keyword only yeild results outside of the cookbook" |
you can search from the docs, the API box |
the cookbook is really just a collection of interesting links |
@jreback, the cookbook entry is related but does it truely close this issue? can't say. |
I also think the cookbook entry is not the real solution to this issue, although you can in principle solve this issue with it (but not that trivially for users I think).
When you have eg regular timeseries of 5 min frequency, this would be the same as @zhangweiwu for the example you give, you can also use the |
Is there any update on this? Very interested in this - very useful for irregular time series that are large data sets |
Folks I would like to help add a similar feature for dataframes with a scalar index or column. Looks like all current windows are based on the number of samples around the point of interest. Any tips / thoughts on where I should start and what the feature should look like? Example, if we have a dataframe with a column "total distance travelled" and another "total fuel used". The rows can be irregular. I'd like to answer max and fuel consumed per 1km travelled. You can get the gist. |
No description provided.
The text was updated successfully, but these errors were encountered: