issues: 572875480
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
572875480 | MDU6SXNzdWU1NzI4NzU0ODA= | 3810 | {DataArray,Dataset}.rank() should support an optional list of dimensions | 7441788 | open | 0 | 10 | 2020-02-28T16:57:08Z | 2021-11-19T15:09:10Z | CONTRIBUTOR |
``` In [1]: import numpy as np, xarray as xr In [2]: d = xr.DataArray(np.arange(12).reshape((4,3)), dims=('abc', 'xyz')) In [3]: d In [4]: d.rank()TypeError Traceback (most recent call last) <ipython-input-4-585571c1eca8> in <module> ----> 1 d.rank() TypeError: rank() missing 1 required positional argument: 'dim' In [5]: d.rank(dim=('xyz', 'abc'))TypeError Traceback (most recent call last) <ipython-input-5-006c73551ff8> in <module> ----> 1 d.rank(dim=('xyz', 'abc')) ~/.conda/envs/build/lib/python3.7/site-packages/xarray/core/dataarray.py in rank(self, dim, pct, keep_attrs) 3054 """ 3055 -> 3056 ds = self._to_temp_dataset().rank(dim, pct=pct, keep_attrs=keep_attrs) 3057 return self._from_temp_dataset(ds) 3058 ~/.conda/envs/build/lib/python3.7/site-packages/xarray/core/dataset.py in rank(self, dim, pct, keep_attrs) 5295 """ 5296 if dim not in self.dims: -> 5297 raise ValueError("Dataset does not contain the dimension: %s" % dim) 5298 5299 variables = {} TypeError: not all arguments converted during string formatting In [6]: xr.show_versions() INSTALLED VERSIONScommit: None python: 3.7.6 | packaged by conda-forge | (default, Jan 7 2020, 22:33:48) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 3.10.0-693.el7.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.3 xarray: 0.15.0 pandas: 1.0.1 numpy: 1.18.1 scipy: 1.4.1 netCDF4: 1.5.3 pydap: None h5netcdf: 0.8.0 h5py: 2.10.0 Nio: None zarr: None cftime: 1.0.4.2 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2.11.0 distributed: 2.11.0 matplotlib: 3.1.3 cartopy: None seaborn: 0.10.0 numbagg: installed setuptools: 45.2.0.post20200209 pip: 20.0.2 conda: 4.8.2 pytest: None IPython: 7.12.0 sphinx: None ``` |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3810/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | issue |