home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 203543958

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
203543958 MDU6SXNzdWUyMDM1NDM5NTg= 1233 2D coordinates to DataArray: erroneous error message 23484003 closed 0     3 2017-01-27T02:20:22Z 2019-02-23T08:47:00Z 2019-02-23T08:47:00Z NONE      

I've got a dataset where one of the coordinates is time, and the other is space, but the spatial coordinate is time-dependent (ie, probe is moving), so I need a different set of x-values at each time point. If I run: from numpy import empty import xarray as xr data=empty((4,5)) x=empty((4,5)) t=empty((4)) xc=('x', x) tc=('t',t) xr.DataArray(data,coords=(tc,xc)) I get this traceback: ``` /home/anaconda/lib/python2.7/site-packages/xarray/core/variable.pyc in _parse_dimensions(self, dims) 335 def _parse_dimensions(self, dims): 336 if isinstance(dims, basestring): 337 dims = (dims,) 338 dims = tuple(dims) 339 if len(dims)!=self.ndim: 340 raise ValueError('dimensions %s must have the same length as the ' 341 'number of data dimensions, ndim=%s' --> 342 % (dims, self.ndim)) 343 return dims 344

ValueError: dimensions ('x',) must have the same length as the number of data dimensions, ndim=2 ``` It looks like the error-check is not functioning correctly, because 'x' obviously has dimension=2, same as 'data'. It would also be helpful to state both the dimensions that are being compared in the error message, and make it clear which is which.

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

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