home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 703991403

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
703991403 MDExOlB1bGxSZXF1ZXN0NDg4OTk2Njk3 4433 Clearer Vectorized Indexing example 5635139 closed 0     3 2020-09-18T00:21:33Z 2020-09-18T18:36:36Z 2020-09-18T15:23:33Z MEMBER   0 pydata/xarray/pulls/4433
  • [x] Passes isort . && black . && mypy . && flake8
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst

I found the existing example not that clear as to why it was selecting [[1,1],[5,5]], I think this is more obvious (open to disagreement of course!)

Before ```python In [37]: da = xr.DataArray( ....: np.arange(12).reshape((3, 4)), ....: dims=["x", "y"], ....: coords={"x": [0, 1, 2], "y": ["a", "b", "c", "d"]}, ....: ) ....:

In [38]: da Out[38]: <xarray.DataArray (x: 3, y: 4)> array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) Coordinates: * x (x) int64 0 1 2 * y (y) <U1 'a' 'b' 'c' 'd'

In [39]: da[[0, 1], [1, 1]] Out[39]: <xarray.DataArray (x: 2, y: 2)> array([[1, 1], [5, 5]]) Coordinates: * x (x) int64 0 1 * y (y) <U1 'b' 'b' ```

After: ```python

In [4]: da[[1, 2, 2], [0, 3]] Out[4]: <xarray.DataArray (x: 3, y: 2)> array([[ 4, 7], [ 8, 11], [ 8, 11]]) Coordinates: * x (x) int64 1 2 2 * y (y) <U1 'a' 'd'` ```

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

Links from other tables

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