issue_comments: 532354509
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/60#issuecomment-532354509 | https://api.github.com/repos/pydata/xarray/issues/60 | 532354509 | MDEyOklzc3VlQ29tbWVudDUzMjM1NDUwOQ== | 4762214 | 2019-09-17T18:54:40Z | 2019-09-17T18:54:40Z | NONE | I got around this with some (masked) numpy operations. perhaps it is useful? I was seeing the ``` test_arr is some array with some nodata value, and is of dims [channels, rows, columns]nodata = -32768 ma = np.ma.masked_equal(test_arr, nodata) use np.any to get a mask of rows/columns which have all masked entriesspec_axis = 0 all_na_mask = np.any(ma, axis=spec_axis) get the argmax across specified axisargm = np.argmax(test_arr, axis=spec_axis) argm = np.ma.masked_less(argm, -np.inf) argm.mask = ~all_na_mask ``` big piece here is modifying the mask directly and making sure that is correct. numpy docs advise against this approach but it seems to be giving me what I want. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
29136905 |