home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 326157080

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/1537#issuecomment-326157080 https://api.github.com/repos/pydata/xarray/issues/1537 326157080 MDEyOklzc3VlQ29tbWVudDMyNjE1NzA4MA== 1217238 2017-08-31T00:41:25Z 2017-08-31T00:41:25Z MEMBER

Two more clues:

LazilyIndexedArray suffices to duplicate this issue: ``` In [20]: ind = xr.core.indexing.LazilyIndexedArray(np.array([True, False, True]))

In [21]: np.arange(3)[ind] Out[21]: array([], shape=(0, 3), dtype=int64) ```

But this simple array wrapper does not: ``` In [17]: class WrappedArray(object): ...: def init(self, array): ...: self.array = array ...: def array(self, dtype=None): ...: return np.asarray(self.array, dtype) ...: def getitem(self, key): ...: return WrappedArray(self.array[key]) ...: @property ...: def shape(self): ...: return self.array.shape ...: @property ...: def dtype(self): ...: return self.array.dtype ...:

In [18]: ind = WrappedArray(np.array([True, False, True]))

In [19]: np.arange(3)[ind] Out[19]: array([0, 2]) ```

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