issue_comments
14 rows where issue = 1548355645 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: reactions, created_at (date), updated_at (date)
issue 1
- xr.DataSet.expand_dims axis option doesn't work · 14 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
1460873349 | https://github.com/pydata/xarray/issues/7456#issuecomment-1460873349 | https://api.github.com/repos/pydata/xarray/issues/7456 | IC_kwDOAMm_X85XEyiF | Karimat22 127195910 | 2023-03-08T21:04:05Z | 2023-06-01T15:42:44Z | NONE | The xr.Dataset.expand_dims() method can be used to add new dimensions to a dataset. The axis parameter is used to specify where to insert the new dimension in the dataset. However, it's worth noting that the axis parameter only works when expanding along a 1D coordinate, not when expanding along a multi-dimensional array. Here's an example to illustrate how to use the axis parameter to expand a dataset along a 1D coordinate: import xarray as xr create a sample datasetdata = xr.DataArray([[1, 2], [3, 4]], dims=('x', 'y')) ds = xr.Dataset({'foo': data}) add a new dimension along the 'x' coordinate using the 'axis' parameterds_expanded = ds.expand_dims({'z': [1]}, axis='x') In this example, we create a 2D array with dimensions x and y, and then add a new dimension along the x coordinate using the axis='x' parameter. However, if you try to use the axis parameter to expand a dataset along a multi-dimensional array, you may encounter an error. This is because expanding along a multi-dimensional array would result in a dataset with non-unique dimension names, which is not allowed in xarray. Here's an example to illustrate this issue: import xarray as xr create a sample dataset with a 2D arraydata = xr.DataArray([[1, 2], [3, 4]], dims=('x', 'y')) ds = xr.Dataset({'foo': data}) add a new dimension along the 'x' and 'y' coordinates using the 'axis' parameterds_expanded = ds.expand_dims({'z': [1]}, axis=('x', 'y')) In this example, we try to use the axis=('x', 'y') parameter to add a new dimension along both the x and y coordinates. However, this results in a ValueError because the resulting dataset would have non-unique dimension names. To add a new dimension along a multi-dimensional array, you can instead use the xr.concat() function to concatenate the dataset with a new data array along the desired dimension: import xarray as xr create a sample dataset with a 2D arraydata = xr.DataArray([[1, 2], [3, 4]], dims=('x', 'y')) ds = xr.Dataset({'foo': data}) add a new dimension along the 'x' and 'y' coordinates using xr.concatds_expanded = xr.concat([ds, xr.DataArray([1], dims=('z'))], dim='z') In this example, we use the xr.concat() function to concatenate the original dataset with a new data array that has a single value along the new dimension z. The dim='z' parameter is used to specify that the new dimension should be named z. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xr.DataSet.expand_dims axis option doesn't work 1548355645 | |
1397549856 | https://github.com/pydata/xarray/issues/7456#issuecomment-1397549856 | https://api.github.com/repos/pydata/xarray/issues/7456 | IC_kwDOAMm_X85TTOsg | cmdupuis3 45972964 | 2023-01-19T20:21:12Z | 2023-01-19T23:54:29Z | NONE | EDIT: Lots of confusion below about nothing, plz disregard Okay, regardless of expected behavior here, my particular use-case requires that I transpose these dimensions. Can someone show me a way to do this? I tried to explain the xarray point of view to Keras, but Keras is really not interested ;) I tried something like |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xr.DataSet.expand_dims axis option doesn't work 1548355645 | |
1397648400 | https://github.com/pydata/xarray/issues/7456#issuecomment-1397648400 | https://api.github.com/repos/pydata/xarray/issues/7456 | IC_kwDOAMm_X85TTmwQ | cmdupuis3 45972964 | 2023-01-19T21:45:24Z | 2023-01-19T21:45:24Z | NONE | I was thinking something like this:
...but this throws an error (like it should). I think I must be reading my code wrong lol |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xr.DataSet.expand_dims axis option doesn't work 1548355645 | |
1397637864 | https://github.com/pydata/xarray/issues/7456#issuecomment-1397637864 | https://api.github.com/repos/pydata/xarray/issues/7456 | IC_kwDOAMm_X85TTkLo | maxrjones 14077947 | 2023-01-19T21:34:09Z | 2023-01-19T21:34:09Z | CONTRIBUTOR |
Can you share your code for this? I would interpret that as meaning you have a variable in your dataset mapped to an integer key, which is allowed as a hashable type but can cause problems with downstream packages. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xr.DataSet.expand_dims axis option doesn't work 1548355645 | |
1397633052 | https://github.com/pydata/xarray/issues/7456#issuecomment-1397633052 | https://api.github.com/repos/pydata/xarray/issues/7456 | IC_kwDOAMm_X85TTjAc | cmdupuis3 45972964 | 2023-01-19T21:29:10Z | 2023-01-19T21:29:10Z | NONE | Okay I think I get the philosophy now. However, indexing a DataSet with an integer actually does work. If performance is the goal, shouldn't something like |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xr.DataSet.expand_dims axis option doesn't work 1548355645 | |
1397627848 | https://github.com/pydata/xarray/issues/7456#issuecomment-1397627848 | https://api.github.com/repos/pydata/xarray/issues/7456 | IC_kwDOAMm_X85TThvI | maxrjones 14077947 | 2023-01-19T21:24:30Z | 2023-01-19T21:24:30Z | CONTRIBUTOR | I'm not an xarray developer, but my guess is that your argument is why positional indexing/slicing is not available for datasets. As for the specific case of using |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xr.DataSet.expand_dims axis option doesn't work 1548355645 | |
1397588476 | https://github.com/pydata/xarray/issues/7456#issuecomment-1397588476 | https://api.github.com/repos/pydata/xarray/issues/7456 | IC_kwDOAMm_X85TTYH8 | cmdupuis3 45972964 | 2023-01-19T20:49:52Z | 2023-01-19T20:53:29Z | NONE | Nvm, my use case isn't what I thought it was, but I'll push the issue a bit. So I'm not disputing anything about what these functions actually do now, the issue I have is that the functions here treat the dimension order of a DataSet as if it's arbitrary, but calling |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xr.DataSet.expand_dims axis option doesn't work 1548355645 | |
1397567627 | https://github.com/pydata/xarray/issues/7456#issuecomment-1397567627 | https://api.github.com/repos/pydata/xarray/issues/7456 | IC_kwDOAMm_X85TTTCL | maxrjones 14077947 | 2023-01-19T20:34:04Z | 2023-01-19T20:34:04Z | CONTRIBUTOR |
The transpose method should change the dimension order on each array in the dataset. One particularly important component from Kai's comment above is that |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xr.DataSet.expand_dims axis option doesn't work 1548355645 | |
1397408991 | https://github.com/pydata/xarray/issues/7456#issuecomment-1397408991 | https://api.github.com/repos/pydata/xarray/issues/7456 | IC_kwDOAMm_X85TSsTf | cmdupuis3 45972964 | 2023-01-19T18:13:16Z | 2023-01-19T18:13:16Z | NONE | Yeah, I could put something together. It'll probably have to wait until next week though. |
{ "total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 1, "rocket": 0, "eyes": 0 } |
xr.DataSet.expand_dims axis option doesn't work 1548355645 | |
1397312215 | https://github.com/pydata/xarray/issues/7456#issuecomment-1397312215 | https://api.github.com/repos/pydata/xarray/issues/7456 | IC_kwDOAMm_X85TSUrX | dcherian 2448579 | 2023-01-19T17:03:35Z | 2023-01-19T17:03:35Z | MEMBER |
Updating the docstring would be a fairly easy and impactful PR if you're up for it! |
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xr.DataSet.expand_dims axis option doesn't work 1548355645 | |
1397292416 | https://github.com/pydata/xarray/issues/7456#issuecomment-1397292416 | https://api.github.com/repos/pydata/xarray/issues/7456 | IC_kwDOAMm_X85TSP2A | cmdupuis3 45972964 | 2023-01-19T16:49:58Z | 2023-01-19T16:52:33Z | NONE | I mean that's fine, but in that case, the documentation is very misleading |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xr.DataSet.expand_dims axis option doesn't work 1548355645 | |
1397025755 | https://github.com/pydata/xarray/issues/7456#issuecomment-1397025755 | https://api.github.com/repos/pydata/xarray/issues/7456 | IC_kwDOAMm_X85TROvb | dcherian 2448579 | 2023-01-19T14:00:49Z | 2023-01-19T14:00:49Z | MEMBER | I think it might be enough to describe this thoroughly with examples in the docstring., though I do like the solution of recommending |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xr.DataSet.expand_dims axis option doesn't work 1548355645 | |
1396923313 | https://github.com/pydata/xarray/issues/7456#issuecomment-1396923313 | https://api.github.com/repos/pydata/xarray/issues/7456 | IC_kwDOAMm_X85TQ1ux | keewis 14808389 | 2023-01-19T12:47:32Z | 2023-01-19T12:48:06Z | MEMBER | I wonder if we shouldn't recommend using |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xr.DataSet.expand_dims axis option doesn't work 1548355645 | |
1396749591 | https://github.com/pydata/xarray/issues/7456#issuecomment-1396749591 | https://api.github.com/repos/pydata/xarray/issues/7456 | IC_kwDOAMm_X85TQLUX | kmuehlbauer 5821660 | 2023-01-19T10:26:56Z | 2023-01-19T10:26:56Z | MEMBER | @cmdupuis3 dimensions are not given in a particular order in the Dataset. There could be two DataArray's which have reversed dimensions for instance. You would need to inspect the DataArray's:
|
{ "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xr.DataSet.expand_dims axis option doesn't work 1548355645 |
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 6