home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 253975242

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
253975242 MDU6SXNzdWUyNTM5NzUyNDI= 1537 Boolean indexing 'by' xr.DataArray 6815844 closed 0     5 2017-08-30T12:08:08Z 2017-08-31T01:39:00Z 2017-08-31T01:39:00Z MEMBER      

Boolean indexing for np.ndarray 'by' a boolean xr.DataArray behaves strange, ```python In [1]: import numpy as np ...: import xarray as xr ...: ...: ind = xr.DataArray([True, True, False], dims=['x']) ...: ind Out[1]: <xarray.DataArray (x: 3)> array([ True, True, False], dtype=bool) Dimensions without coordinates: x

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

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

numpy==1.11 behaves differently, ```python

np.arange(3)[ind.values] array([0, 1])

np.arange(3)[ind] main:1: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future Traceback (most recent call last): File "<stdin>", line 1, in <module> IndexError: too many indices for array ```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1537/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 5 rows from issue in issue_comments
Powered by Datasette · Queries took 81.198ms · About: xarray-datasette