home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 1454968267

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/7581#issuecomment-1454968267 https://api.github.com/repos/pydata/xarray/issues/7581 1454968267 IC_kwDOAMm_X85WuQ3L 39069044 2023-03-05T02:45:42Z 2023-03-05T02:45:42Z CONTRIBUTOR

xr.where(cond, x, y, keep_attrs=True) unambiguously takes the attributes of x as described in the docs, even if x is a scalar and has no attributes. This can be inconvenient at times but is intentional for consistency. You can invert the condition as you suggest, or better yet use DataArray.where/Dataset.where to ensure you are getting the attrs you expect.

In what case would a!=0 not mirror a==0?

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