home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 203689249

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-203689249 https://api.github.com/repos/pydata/xarray/issues/811 203689249 MDEyOklzc3VlQ29tbWVudDIwMzY4OTI0OQ== 4295853 2016-03-30T23:54:03Z 2016-03-30T23:54:03Z CONTRIBUTOR

Sorry about the poor word choice, what I really mean by "contraction" is "slice". The example below will hopefully demonstrate. I think sel_from or sel_where is probably better anyway. The idea is to provide boolean indexing a la http://docs.scipy.org/doc/numpy-1.10.1/user/basics.indexing.html. In this case though, if a dimension is not used assume it is broadcast to preserve the dimension similar to orthogonal indexing. Essentially, I'm looking for a where mask that simply removes array entries instead of replacing them with nan. Thus, the method could also be called sel_where.

Pseudo code is below to demonstrate key feature of method

```

assume idx is boolean and

when True represents values that should be returned by a slice like behavior

let idx dims be ('x' and 'y')

$ idx.shape

(1000,1000) $ np.sum(idx.values,axis=0) 10 $ np.sum(idx.values,axis=1) 20 $ acase.shape (1000,1000) $ slicedcase = acase.sel_where(idx) $ slicedcase.shape (10, 20)

```

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