home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 203639698

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/811#issuecomment-203639698 https://api.github.com/repos/pydata/xarray/issues/811 203639698 MDEyOklzc3VlQ29tbWVudDIwMzYzOTY5OA== 4295853 2016-03-30T21:17:32Z 2016-03-30T21:17:32Z CONTRIBUTOR

I would argue that the intuitive behavior, even if it is a departure from numpy, is to make acase.sel(idx) be short hand for acase.sel(x=idx.x.values, y=idx.y.values) which would preserve the original dimensionality, but not necessarily the shape of acase because if a dimension is all False then that dimension should be dropped completely. This is because the sel method essentially operates on key-value pairs, or dictionary-like data.

I don't thing acase[idx] would make as much sense because this is closer to standard numpy notation where acase has two dimensions and it is possible that the dimensional arangement for acase and idx don't match (e.g., they could dimensionally be transposes of each other). If I understand correctly, arguments to the [] operator should essentially be data types, not a dictionary type. So this would be consistent because we can think of idx as a glorified dict with metadata whereas it is not a pure number type. Some type of dereferrencing operation is needed for the "dict" idx to become a data type. A carefully worded error should probably be returned here.

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