issue_comments
5 rows where issue = 594900245 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: reactions, created_at (date), updated_at (date)
issue 1
- Sum based on start_index and end_index array · 5 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
610142267 | https://github.com/pydata/xarray/issues/3941#issuecomment-610142267 | https://api.github.com/repos/pydata/xarray/issues/3941 | MDEyOklzc3VlQ29tbWVudDYxMDE0MjI2Nw== | zxdawn 30388627 | 2020-04-07T02:45:26Z | 2020-04-07T02:45:26Z | NONE | @dcherian Sorry for the misunderstanding. I tried again for the 3d array, it works well ;) ``` import xarray as xr import numpy as np x = 2 y = 4 z = 3 data = np.arange(xyz).reshape(z, x, y) input arraya = xr.DataArray(data, dims=['z', 'y', 'x']) start_index arraysindex = xr.DataArray(np.full_like(a[0, ...], 0), dims=['y', 'x']) end_index arrayeindex = xr.DataArray(np.full_like(a[0, ...], 1), dims=['y', 'x']) zindex = a.z.copy(data=np.arange(a.sizes["z"])) sub_z = (zindex >= sindex) & (zindex <= eindex) sum_a = a.where(sub_z).sum('z', keepdims=True) print(a) print(sum_a) ``` ``` <xarray.DataArray (z: 3, y: 2, x: 4)> array([[[ 0, 1, 2, 3], [ 4, 5, 6, 7]],
Dimensions without coordinates: z, y, x <xarray.DataArray (z: 1, y: 2, x: 4)> array([[[ 8., 10., 12., 14.], [16., 18., 20., 22.]]]) Dimensions without coordinates: z, y, x ``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Sum based on start_index and end_index array 594900245 | |
609882875 | https://github.com/pydata/xarray/issues/3941#issuecomment-609882875 | https://api.github.com/repos/pydata/xarray/issues/3941 | MDEyOklzc3VlQ29tbWVudDYwOTg4Mjg3NQ== | dcherian 2448579 | 2020-04-06T15:59:37Z | 2020-04-06T15:59:37Z | MEMBER | why not? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Sum based on start_index and end_index array 594900245 | |
609850841 | https://github.com/pydata/xarray/issues/3941#issuecomment-609850841 | https://api.github.com/repos/pydata/xarray/issues/3941 | MDEyOklzc3VlQ29tbWVudDYwOTg1MDg0MQ== | zxdawn 30388627 | 2020-04-06T15:04:23Z | 2020-04-06T15:04:23Z | NONE | @dcherian Excellent solution! If we upgrade this to 3d array and sum by ``` import xarray as xr import numpy as np x = 2 y = 2 z = 3 data = np.arange(xyz).reshape(z, y, x) input arraya = xr.DataArray(data, dims=['z', 'y', 'x']) start_index arraysindex = xr.DataArray(np.full_like(a[0, ...], 0), dims=['y', 'x']) end_index arrayeindex = xr.DataArray(np.full_like(a[0, ...], 1), dims=['y', 'x']) ``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Sum based on start_index and end_index array 594900245 | |
609827384 | https://github.com/pydata/xarray/issues/3941#issuecomment-609827384 | https://api.github.com/repos/pydata/xarray/issues/3941 | MDEyOklzc3VlQ29tbWVudDYwOTgyNzM4NA== | dcherian 2448579 | 2020-04-06T14:24:53Z | 2020-04-06T14:24:53Z | MEMBER |
Please close if this answers your question. |
{ "total_count": 4, "+1": 4, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Sum based on start_index and end_index array 594900245 | |
609728948 | https://github.com/pydata/xarray/issues/3941#issuecomment-609728948 | https://api.github.com/repos/pydata/xarray/issues/3941 | MDEyOklzc3VlQ29tbWVudDYwOTcyODk0OA== | zxdawn 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 } |
Sum based on start_index and end_index array 594900245 |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issue_comments] ( [html_url] TEXT, [issue_url] TEXT, [id] INTEGER PRIMARY KEY, [node_id] TEXT, [user] INTEGER REFERENCES [users]([id]), [created_at] TEXT, [updated_at] TEXT, [author_association] TEXT, [body] TEXT, [reactions] TEXT, [performed_via_github_app] TEXT, [issue] INTEGER REFERENCES [issues]([id]) ); CREATE INDEX [idx_issue_comments_issue] ON [issue_comments] ([issue]); CREATE INDEX [idx_issue_comments_user] ON [issue_comments] ([user]);
user 2