home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 132818023

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
132818023 MDU6SXNzdWUxMzI4MTgwMjM= 758 No check for dimension compatibility on DataArray creation 2783717 closed 0     1 2016-02-10T21:08:32Z 2016-02-15T02:21:33Z 2016-02-15T02:21:33Z NONE      

When creating a DataArray with an iterable of coordinates, no check is made that the dimensions of the coordinates match the shape of the data. Unsure if there's a reason why this isn't checked in xarray or not (I'd expect it to be). This may also just me using xarray wrong. I got bit by this earlier with a typo in my code:

``` python In [1]: import xarray as xr

In [2]: import numpy as np

In [3]: a = np.arange(6).reshape((2, 3))

In [4]: x = np.arange(3)

In [5]: y = np.arange(2, 4)

In [6]: xa = xr.DataArray(a, coords=[x, x], dims=['x', 'y']) # Oop, gave x twice, instead of [x, y]

In [7]: xa.shape Out[7]: (2, 3)

In [8]: xa.coords Out[8]: Coordinates: * x (x) int64 0 1 2 * y (y) int64 0 1 2 ```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/758/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
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.707ms · About: xarray-datasette