issue_comments: 426340226
This data as json
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/pydata/xarray/issues/2450#issuecomment-426340226 | https://api.github.com/repos/pydata/xarray/issues/2450 | 426340226 | MDEyOklzc3VlQ29tbWVudDQyNjM0MDIyNg== | 6628425 | 2018-10-02T16:28:42Z | 2018-10-02T16:28:42Z | MEMBER | I'm not sure if I'm understanding the calculation correctly; is something like the following what you are looking for? ``` In [1]: import numpy as np; import pandas as pd; import xarray as xr In [2]: times = pd.date_range('1979', periods=4, freq='12H') In [3]: da = xr.DataArray(np.random.rand(4, 2, 3), coords={'time': times}, dims=['time', 'x', 'y']) In [4]: threshold = 0.5 In [5]: (da > threshold).mean('time') Out[5]: <xarray.DataArray (x: 2, y: 3)> array([[ 0.25, 0.5 , 0.25], [ 0.25, 0.5 , 0.5 ]]) Dimensions without coordinates: x, y ``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
365438396 |