home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 756415834

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
756415834 MDU6SXNzdWU3NTY0MTU4MzQ= 4647 DataArray transpose inconsistent with Dataset Ellipsis usage 15331990 closed 0     7 2020-12-03T17:52:16Z 2021-01-05T23:45:03Z 2021-01-05T23:45:03Z CONTRIBUTOR      

This works: import xarray as xr ds = xr.tutorial.open_dataset('air_temperature') ds.transpose('not_existing_dim', 'lat', 'lon', 'time', ...)

This doesn't (subset air): import xarray as xr ds = xr.tutorial.open_dataset('air_temperature') ds['air'].transpose('not_existing_dim', 'lat', 'lon', 'time', ...)

The error message is a bit inaccurate too since I do have Ellipsis included; might be related to two calls of: dims = tuple(utils.infix_dims(dims, self.dims)) ```

ValueError: ('not_existing_dim', 'lat', 'lon', 'time') must be a permuted list of ('time', 'lat', 'lon'), unless ... is included

Traceback ...


ValueError Traceback (most recent call last) <ipython-input-5-793dfc1507ea> in <module> 2 ds = xr.tutorial.open_dataset('air_temperature') 3 ds.transpose('not_existing_dim', 'lat', 'lon', 'time', ...) ----> 4 ds['air'].transpose('not_existing_dim', 'lat', 'lon', 'time', ...)

~/anaconda3/envs/py3/lib/python3.7/site-packages/xarray/core/dataarray.py in transpose(self, transpose_coords, dims) 2035 if dims: 2036 dims = tuple(utils.infix_dims(dims, self.dims)) -> 2037 variable = self.variable.transpose(dims) 2038 if transpose_coords: 2039 coords: Dict[Hashable, Variable] = {}

~/anaconda3/envs/py3/lib/python3.7/site-packages/xarray/core/variable.py in transpose(self, *dims) 1388 if len(dims) == 0: 1389 dims = self.dims[::-1] -> 1390 dims = tuple(infix_dims(dims, self.dims)) 1391 axes = self.get_axis_num(dims) 1392 if len(dims) < 2 or dims == self.dims:

~/anaconda3/envs/py3/lib/python3.7/site-packages/xarray/core/utils.py in infix_dims(dims_supplied, dims_all) 724 if set(dims_supplied) ^ set(dims_all): 725 raise ValueError( --> 726 f"{dims_supplied} must be a permuted list of {dims_all}, unless ... is included" 727 ) 728 yield from dims_supplied ```

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