-
Notifications
You must be signed in to change notification settings - Fork 908
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
Extend TimeSeries.resample()
to be more like pandas resample()
#699
Comments
Hi @vfilter and thanks for writing. Our
It is true that it would be nice to extend our method to be more like pandas` resample. I will add this to our backlog. You can achieve the desired results with:
|
TimeSeries.resample()
to be more like pandas resample()
Pandas returns a |
Following this issue with interest! Aggregate resample is critical to many of our workflows. Currently, we're using this function to retain timeseries metadata attributes, but it feels a bit hacky def ts_resample(ts, freq="Y", agg="sum"):
tmp = TimeSeries.from_dataframe(ts.pd_dataframe().resample(freq).agg(agg))
tmp = tmp.with_static_covariates(ts.static_covariates)
tmp = tmp.with_hierarchy(ts.hierarchy)
return tmp |
Describe the bug
Hi, I'm trying to downsample a high-frequency Darts time series object to daily/monthly/yearly mean/sum/min/max etc. But the behavior is different than Pandas, so my only current option is to downsample before converting to a time series object.
To Reproduce
Results in
component Pounds per cow 10094.0 dtype: float64
Expected behavior
Expected a time series with the sum of each year, rather than the sum of all years. That is the default behaviour of the pandas resample method and I'm having a hard time understanding why this wouldn't work in Darts.
System (please complete the following information):
The text was updated successfully, but these errors were encountered: