issue_comments: 609728948
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/3941#issuecomment-609728948 | https://api.github.com/repos/pydata/xarray/issues/3941 | 609728948 | MDEyOklzc3VlQ29tbWVudDYwOTcyODk0OA== | 30388627 | 2020-04-06T11:09:10Z | 2020-04-06T11:09:10Z | NONE | Solution (Boolean) ``` stack indexesindex_list = np.column_stack((sindex, eindex)) all false arrayboolean_array = np.zeros(a.shape, dtype=bool) iterate and assign truefor row in range(len(index_list)): boolean_array[row, np.arange(index_list[row][0], index_list[row][1]+1)] = True sum_a = a.where(boolean_array).sum(dim='y') ``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
594900245 |