home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 605654288

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/1428#issuecomment-605654288 https://api.github.com/repos/pydata/xarray/issues/1428 605654288 MDEyOklzc3VlQ29tbWVudDYwNTY1NDI4OA== 14808389 2020-03-29T15:28:52Z 2020-03-29T15:28:52Z MEMBER

This is a special case for a coordinate along the groupby dimension: since for each group the groupby dimension coordinate is a scalar, it is not treated as a dimension. This means new_coord is 0D and thus won't be concatenated (resulting in a Dataset with a correct z, but a 0D new_coord). To make up for that, the code adds back the dimensions not in a group (z) and along with it all coords along that dimension, overwriting the 0D new_coord with the original 1D new_coord.

If we'd want to do something about that, I guess we'd need to modify the concatenation code to know about the groupby dimension and its coords?

As a workaround, we can modify the original coord (note the [...]): python def change_new_coord(dar): """ change the new_coord coord from 1 to 0 """ dar.coords['new_coord'][...] = 0 return dar

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