How to get the index corresponding to the maximum for a resampled array? #5117
Unanswered
AndrewILWilliams
asked this question in
Q&A
Replies: 2 comments 4 replies
-
Follow up, I'd also like to be able to do this for different month groupings as well. i.e., what is the time-index corresponding to the maximum precipitation value within May-September (MJJAS) in each year. I think I should be able to do this with some clever masking, but I'd still require to be able to use mjjas_mask = (da_hist.time.dt.month >= 5) & (da_hist.time.dt.month <= 9)
da_hist.where(mjjas_mask).resample(time='1Y').argmax('time').compute() |
Beta Was this translation helpful? Give feedback.
2 replies
-
Ok, I'm confused... it seems like you USED to be able to do this in v0.15.1, but you can't now? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I have a
DataArray
of precipitation withtime, lat, lon
coordinates, and I would like to find the time index which corresponds to the maximum precipitation value in a given year.I thought that perhaps I could use
da_hist.resample(time='1Y').argmax('time')
, but it seems thatargmax
hasn't been implemented for resampled objects yet?Does anyone know a good way around this? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions