home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 239506907

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/pull/964#issuecomment-239506907 https://api.github.com/repos/pydata/xarray/issues/964 239506907 MDEyOklzc3VlQ29tbWVudDIzOTUwNjkwNw== 1217238 2016-08-12T17:21:25Z 2016-08-12T17:22:32Z MEMBER

@MaximilianR Two issues come to mind with remapping da[condition] = other -> da = da.where(bool_array, other): 1. What should da[bool_array] return? For consistency, I think we need to support both. We could alias that to where, too (da[bool_array] -> da.where(bool_array)), but this would be inconsistent with the existing behavior of da[bool_array] if da and bool_array are one-dimensional. This suggests maybe ds[bool_array] -> da.where(bool_array, drop=True). 2. What is other is not a scalar value, but is a DataArray? Currently, I don't think we align when indexing, but in this case, by necessity we would. For __getitem__ indexing, it's pretty obvious that alignment should preserve the indexes of the object being indexed. For __setitem__ indexing, I'm not sure. At the least they would be a little different from the defaults for where (which does an inner join like most xarray operations by default). Maybe something like: left_join(da, inner_join(bool_array, other))? We need to make sure that every xarray assignment like obj[key] or obj[key] = value (and also .loc and .sel and so on) works sanely with these alignment rules.

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