Example of vectorizing ruptures with xarray.apply_ufunc #139
spencerahill
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(originally Issue #136)
In case others come across a similar need (whether or not it makes sense to implement this into ruptures proper), here's a way of using xarray.apply_ufunc to perform calculations on rupture on xarray.DataArrays.
This particular example is for detecting a single breakpoint; note that if you want to return multiple, the apply_ufunc call signature will have to be modified, because then each call is returning an array rather than a scalar.
(FYI This came up when attempting to detect changepoints at each point of a lat-lon gridded rainfall dataset.)
Beta Was this translation helpful? Give feedback.
All reactions