Skip to content
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

Method for aggregation #164

Open
ValentinKaisermayer opened this issue May 18, 2023 · 4 comments
Open

Method for aggregation #164

ValentinKaisermayer opened this issue May 18, 2023 · 4 comments

Comments

@ValentinKaisermayer
Copy link
Contributor

The method should accept a Dates.Period and apply a function to each of those periods in the TSFrame. Like computing the daily mean of hourly data. Control over the time index that is used in the output would also be nice. Like should the first be used or the last in the period.

@ValentinKaisermayer
Copy link
Contributor Author

Computing the daily mean from hourly data is easy, since it is simply 24 vales each, but the monthly or yearly mean would be harder, since not every period might be of the same length.

@smishr
Copy link

smishr commented Sep 13, 2023

@chiraganand @codetalker7 Your thoughts on this feature?

@ValentinKaisermayer
Copy link
Contributor Author

One easy way is to simply apply the given method, i.e. month to the timestamps and then compute the intervals for the aggregation when this changes. idx = findall(diff(month.(timestamps))). Or in a for-loop.

@chiraganand
Copy link
Member

Doesn't apply() handle this use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants