issue_comments
11 rows where issue = 40395257 and user = 291576 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
issue 1
- Pointwise indexing -- something like sel_points · 11 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
58570858 | https://github.com/pydata/xarray/issues/214#issuecomment-58570858 | https://api.github.com/repos/pydata/xarray/issues/214 | MDEyOklzc3VlQ29tbWVudDU4NTcwODU4 | WeatherGod 291576 | 2014-10-09T20:19:12Z | 2014-10-09T20:19:12Z | CONTRIBUTOR | Ok, I think I got it (for reals this time...) ``` def bcast(spat_only, coord_names): coords = [] for i, n in enumerate(coord_names): if spat_only[n].ndim != len(spat_only.dims): # Needs new axes slices = [np.newaxis] * len(spat_only.dims) slices[i] = slice(None) else: slices = [slice(None)] * len(spat_only.dims) coords.append(spat_only[n].values[slices]) return np.broadcast_arrays(*coords) def grid_to_points2(grid, points, coord_names): if not coord_names: raise ValueError("No coordinate names provided") spat_dims = {d for n in coord_names for d in grid[n].dims} not_spatial = set(grid.dims) - spat_dims spatial_selection = {n:0 for n in not_spatial} spat_only = grid.isel(**spatial_selection)
``` Needs a lot more tests and comments and such, but I think this works. Best part is that it seems to do a very decent job of keeping memory usage low, and only operates upon the coordinates that I specify. Everything else is left alone. So, I have used this on 4-D data, picking out grid points at specified lat/lon positions, and get back a 3D result (time, level, station). And I have used this on just 2D data, getting back just a 1D result (dimension='station'). |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Pointwise indexing -- something like sel_points 40395257 | |
58568933 | https://github.com/pydata/xarray/issues/214#issuecomment-58568933 | https://api.github.com/repos/pydata/xarray/issues/214 | MDEyOklzc3VlQ29tbWVudDU4NTY4OTMz | WeatherGod 291576 | 2014-10-09T20:05:01Z | 2014-10-09T20:05:01Z | CONTRIBUTOR | Consider the following Dataset:
The latitude and longitude variables are both dependent upon xgrid_0 and ygrid_0. Meanwhile...
the latitude and longitude variables are independent of each other (they are 1-D). The variable in the first one can not be accessed directly by lat/lon values, while the MaxGust variable in the second one can. This poses some difficulties. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Pointwise indexing -- something like sel_points 40395257 | |
58565934 | https://github.com/pydata/xarray/issues/214#issuecomment-58565934 | https://api.github.com/repos/pydata/xarray/issues/214 | MDEyOklzc3VlQ29tbWVudDU4NTY1OTM0 | WeatherGod 291576 | 2014-10-09T19:43:08Z | 2014-10-09T19:43:08Z | CONTRIBUTOR | Hmmm, limitation that I just encountered. When there are dependent coordinates, the variables representing those coordinates are not the index arrays (and thus, are not "dimensions" either), so my solution is completely broken for dependent coordinates. If I were to go back to my DataArray-only solution, then I still need to correct the code to use the dimension names of the coordinate variables, and still need to fix the coordinates != dimensions issue. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Pointwise indexing -- something like sel_points 40395257 | |
58562506 | https://github.com/pydata/xarray/issues/214#issuecomment-58562506 | https://api.github.com/repos/pydata/xarray/issues/214 | MDEyOklzc3VlQ29tbWVudDU4NTYyNTA2 | WeatherGod 291576 | 2014-10-09T19:16:52Z | 2014-10-09T19:16:52Z | CONTRIBUTOR | to/from_dateframe just ate up all my memory. I think I am going to stick with my broadcasting approach... |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Pointwise indexing -- something like sel_points 40395257 | |
58558069 | https://github.com/pydata/xarray/issues/214#issuecomment-58558069 | https://api.github.com/repos/pydata/xarray/issues/214 | MDEyOklzc3VlQ29tbWVudDU4NTU4MDY5 | WeatherGod 291576 | 2014-10-09T18:47:22Z | 2014-10-09T18:47:22Z | CONTRIBUTOR | oooh, didn't realize that |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Pointwise indexing -- something like sel_points 40395257 | |
58553935 | https://github.com/pydata/xarray/issues/214#issuecomment-58553935 | https://api.github.com/repos/pydata/xarray/issues/214 | MDEyOklzc3VlQ29tbWVudDU4NTUzOTM1 | WeatherGod 291576 | 2014-10-09T18:21:16Z | 2014-10-09T18:21:16Z | CONTRIBUTOR | And, actually, the example I gave above has a bug in the dependent dimension case. This one should be much better (not fully tested yet, though): ``` def grid_to_points2(grid, points, coord_names): if not coord_names: raise ValueError("No coordinate names provided") not_spatial = set(grid.dims) - set(coord_names) spatial_selection = {n:0 for n in not_spatial} spat_only = grid.isel(*spatial_selection) coords = [] for i, n in enumerate(spat_only.dims): if spat_only[n].ndim != len(spat_only.dims): # Needs new axes slices = [np.newaxis] * len(spat_only.dims) slices[i] = slice(None) else: slices = [slice(None)] * len(spat_only.dims) coords.append(spat_only[n].values[slices]) coords = np.broadcast_arrays(coords)
``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Pointwise indexing -- something like sel_points 40395257 | |
58551759 | https://github.com/pydata/xarray/issues/214#issuecomment-58551759 | https://api.github.com/repos/pydata/xarray/issues/214 | MDEyOklzc3VlQ29tbWVudDU4NTUxNzU5 | WeatherGod 291576 | 2014-10-09T18:06:56Z | 2014-10-09T18:06:56Z | CONTRIBUTOR | And, I think I just realized how I could generalize it even more. Right now, |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Pointwise indexing -- something like sel_points 40395257 | |
58550741 | https://github.com/pydata/xarray/issues/214#issuecomment-58550741 | https://api.github.com/repos/pydata/xarray/issues/214 | MDEyOklzc3VlQ29tbWVudDU4NTUwNzQx | WeatherGod 291576 | 2014-10-09T18:00:33Z | 2014-10-09T18:00:33Z | CONTRIBUTOR | Oh, and it does take advantage of a bunch of python2.7 features such as dictionary comprehensions and generator statements, so... |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Pointwise indexing -- something like sel_points 40395257 | |
58550403 | https://github.com/pydata/xarray/issues/214#issuecomment-58550403 | https://api.github.com/repos/pydata/xarray/issues/214 | MDEyOklzc3VlQ29tbWVudDU4NTUwNDAz | WeatherGod 291576 | 2014-10-09T17:58:25Z | 2014-10-09T17:58:25Z | CONTRIBUTOR | Starting using the above snippet for more datasets, some with interdependent coordinates and some without (so the coordinates would be 1-d). I think I have generalized it significantly... ``` def grid_to_points(grid, points, coord_names): not_spatial = set(grid.dims) - set(coord_names) spatial_selection = {n:0 for n in not_spatial} spat_only = grid.isel(*spatial_selection) coords = [] for i, n in enumerate(spat_only.dims): if spat_only[n].ndim != len(spat_only.dims): # Needs new axes slices = [np.newaxis] * len(spat_only.dims) slices[i] = slice(None) else: slices = [slice(None)] * len(spat_only.dims) coords.append(spat_only[n].values[slices]) coords = [c.flatten() for c in np.broadcast_arrays(coords)]
``` I can still imagine some situations where this won't work, such as a requested set of dimensions that are a mix of dependent and independent variables. Currently, if the dimensions are independent, then the number of dimensions of each one is assumed to be 1 and np.newaxis is used for the others. Meanwhile, if the dimensions are dependent, then the number of dimensions for each one is assumed to be the same as the number of dependent variables and is merely flattened (the broadcast is essentially no-op). I should also note that this is technically not restricted to spatial coordinates even though the code says so. Just anything that can be represented in euclidean space. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Pointwise indexing -- something like sel_points 40395257 | |
57857522 | https://github.com/pydata/xarray/issues/214#issuecomment-57857522 | https://api.github.com/repos/pydata/xarray/issues/214 | MDEyOklzc3VlQ29tbWVudDU3ODU3NTIy | WeatherGod 291576 | 2014-10-03T20:48:35Z | 2014-10-03T20:48:35Z | CONTRIBUTOR | Just managed to implement this using your suggestion for my data:
Not entirely certain why I needed to reverse y and x in that last part, but, oh well... |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Pointwise indexing -- something like sel_points 40395257 | |
57847940 | https://github.com/pydata/xarray/issues/214#issuecomment-57847940 | https://api.github.com/repos/pydata/xarray/issues/214 | MDEyOklzc3VlQ29tbWVudDU3ODQ3OTQw | WeatherGod 291576 | 2014-10-03T19:56:16Z | 2014-10-03T19:56:16Z | CONTRIBUTOR | Unless I am missing something about xray, that selection operation could only work if |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Pointwise indexing -- something like sel_points 40395257 |
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 1