home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 203676582

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-203676582 https://api.github.com/repos/pydata/xarray/issues/811 203676582 MDEyOklzc3VlQ29tbWVudDIwMzY3NjU4Mg== 4295853 2016-03-30T23:08:14Z 2016-03-30T23:46:02Z CONTRIBUTOR

Agreed. I think a sel_like method would work well to mirror the reindex/reindex_like notation.

To be clear for people listening for the distinction between this use case and that covered by reindex/reindex_like can be summarized as follows:

reindex_like does not do a contraction on whether the dataArray idx is True or False. There are many use cases where one will want to reduce the size of the data file (e.g., subseting a region from global climate model data). reindex_like preserves the shape of idx and not its collapsed shape based on a np.sum over each axis. A sel_like method will perform the contraction and the size that should be returned from idx along each axis should will be np.sum(idx,axis=axis) not just idx.shape[axis] as would occur for reindex_like.

@shoyer, are you in support of a PR that implements a sel_like to do a mapping of the form acase.sel_like(idx) -> acase.sel(x=idx.x.values, y=idx.y.values)?

{
    "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 65.278ms · About: xarray-datasette