Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was wondering if it is possible to apply "mode" to a coarsened array object, instead of mean, min, or max, etc. I know that numpy does not have a mode function, and so I was wanting to use the scipy.stats.mode function and apply it. I've looked at xr.apply_ufunc() but have had little luck getting it to work taking the mode of the coarsened object.
For example, lets say I have a dataarray with dims (lat, lon) and shape (415, 725) and I want to coarsen it every 5 grid cells. I was going to do datarray.coarsen(lat=5, lon=5) but am not sure the best way to get the mode of my values that are "grouped" in each larger gridcell, which is what I need.
Beta Was this translation helpful? Give feedback.
All reactions