issues: 543825272
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
543825272 | MDU6SXNzdWU1NDM4MjUyNzI= | 3656 | apply rolling window on function | 44284270 | closed | 0 | 5 | 2019-12-30T10:16:27Z | 2021-02-12T00:05:52Z | 2021-02-12T00:05:51Z | NONE | I am looking for how to apply xarray rolling window to this function. I have really searched a lot but my effort is still futile.. My data is xarray data of shape (time, lon, lat) (323x180x360) respectively ```python def get_grps(s,axis=0, thresh=-1, Nmin=2): """ Nmin : int > 0 Min number of consecutive values below threshold. """ s = pd.Series(s) m = np.logical_and.reduce([s.shift(-i).le(thresh) for i in range(Nmin)]) if Nmin > 1: m = pd.Series(m, index=s.index).replace({False: np.NaN}).ffill(limit=Nmin-1).fillna(False) else: m = pd.Series(m, index=s.index)
``` I tried this
I get this error
How can I rectify this? Thanks |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3656/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |