-
Notifications
You must be signed in to change notification settings - Fork 283
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
Weighted mean in cube.aggregated_by #3290
Comments
Absolutely yes, it does support a 'weights' keyword |
Hi Patrick! I'm seeing the error message:
Which seems to come from:
in iris/cube.py:3363 and we're in iris version 2.2.0. It probably isn't the culprit, but the function that you're linking is the |
Sorry, my bad !! 👎 |
In principle, this seems possible... I think it might be worthwhile taking a step back here and holistically rationalising how aggregation and collapse works. Unifying behaviour for use of weights (where appropriate for the statistic) consistently would be a good win - plus there is some technical debt for us to purge, as there is a major overlap between aggregation and collapse that we should take advantage of; I've been itching to do that for years. The topic of operator laziness (#3280) is also relevant here... and that needs a wee bit more thought. You'd certainly throw away coordinate laziness, but it seems reasonable to expect to keep the data lazy. |
👍 great summary! I might just add, can we also consider getting rid of the "two-speed" separate lazy/real implementations ? (as in #2418) |
In order to maintain a backlog of relevant issues, we automatically label them as stale after 500 days of inactivity. If this issue is still important to you, then please comment on this issue and the stale label will be removed. Otherwise this issue will be automatically closed in 28 days time. |
This stale issue has been automatically closed due to a lack of community activity. If you still care about this issue, then please either:
|
This was implemented in #4589 |
Great work, thanks to the iris team! This will be very useful in the future. Now if I can only remember what I was trying to do back in March 2019, lol. |
Hi,
is it possible to use weights to calculate the mean while using
cube.aggregated_by
.For instance, I have a cube with several years of monthly data, and I want to produce an annual mean. I have previously used:
However, this means that the shorter months have the same weighting as the longer months. Is there a weight to weight this calculation by some given weights. (Lets assume that I've calculated them elsewhere!)
ie:
Thanks!
The text was updated successfully, but these errors were encountered: