home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 830666545

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/5240#issuecomment-830666545 https://api.github.com/repos/pydata/xarray/issues/5240 830666545 MDEyOklzc3VlQ29tbWVudDgzMDY2NjU0NQ== 14808389 2021-05-01T17:32:57Z 2021-05-01T17:33:04Z MEMBER

would've expected the name of the new coordinate to be the name of the DataArray variable

that's exactly what it's doing: it uses the name of DataArray([0, 1], dims='b'), which is None. To fix that, you can assign a name to the DataArray: python In [3]: a = xr.DataArray([0], dims='a') ...: out = xr.concat([a, a], dim=xr.DataArray([0, 1], dims='b', name="x")) ...: out Out[3]: <xarray.DataArray (b: 2, a: 1)> array([[0], [0]]) Coordinates: x (b) int64 0 1 Dimensions without coordinates: b, a

Since None is not a particularly good name, we could raise for unnamed DataArray objects (not sure if falling back to dims for 1D DataArray objects would be a good idea)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  873713013
Powered by Datasette · Queries took 0.674ms · About: xarray-datasette