home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 356661287

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/1646#issuecomment-356661287 https://api.github.com/repos/pydata/xarray/issues/1646 356661287 MDEyOklzc3VlQ29tbWVudDM1NjY2MTI4Nw== 1217238 2018-01-10T16:44:00Z 2018-01-10T16:44:00Z MEMBER

What is the desired behaviour in this case viz. do we preserve dimension name new_dim or assign new name stat?

Oh, this is trickier than I thought!

The challenge is that once you make the DataArray, there is no good way to know if a default dimension name like 'dim_0' was intentional or not.

The way to handle this currently is to pass a 1-dimensional xarray.Variable object for the dim argument. These don't have separate names, so there's no ambiguity: In [5]: xarray.concat([xarray.DataArray(1), xarray.DataArray(2)], dim=xarray.Variable('x', [3, 4])) Out[5]: <xarray.DataArray (x: 2)> array([1, 2]) Coordinates: * x (x) int64 3 4

But this is a little verbose. Potentially we could call xarray.as_variable() on tuple inputs (like in the Dataset constructor) so dim=('x', [3, 4]) works.

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