home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 232726778

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
232726778 MDU6SXNzdWUyMzI3MjY3Nzg= 1436 Wrong dimension referenced in boolean indexing with .loc 11671536 closed 0     3 2017-05-31T23:35:08Z 2017-10-19T23:54:03Z 2017-10-19T23:54:03Z NONE      

I am using Ubuntu 16, python 3.6, and xarary 0.9.5.

```python import numpy as np import xarray as xr

setup for a simple grid

DX = 50 X = np.arange(0, 2010, DX) Y = np.arange(0, 2010, DX) Z = np.arange(0, 2010, DX) grid_shape = (len(X), len(Y), len(Z))

Create data array

dims = 'X Y Z'.split() coords = {'X': X, 'Y': Y, 'Z': Z} dar = xr.DataArray(np.ones(grid_shape), dims=dims, coords=coords)

slice the data array so that all Z values are greater than 1000

dar2 = dar.loc[dar.Z > 1000] assert np.all(dar2.Z > 1000) # fails becase dar is sliced along X, not Z ``` Since the object returned from dar.Z > 1000 is a data array with "Z" as the only dim I would expect this to slice the "Z" dim rather than X.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1436/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

  • 1 row from issues_id in issues_labels
  • 3 rows from issue in issue_comments
Powered by Datasette · Queries took 0.579ms · About: xarray-datasette