home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 498297720

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
498297720 MDU6SXNzdWU0OTgyOTc3MjA= 3343 Interpolation using non-dimension coordinates 601177 open 0     4 2019-09-25T13:45:38Z 2019-09-30T12:53:35Z   NONE      

MCVE Code Sample

```python

da = xr.DataArray([1., 2.], coords=[('dim', [.5, 1.])]) da.coords['nondim'] = ('dim', [0., 1.]) da <xarray.DataArray (dim: 2)> array([1., 2.]) Coordinates: * dim (dim) float64 0.5 1.0 nondim (dim) float64 0.0 1.0 da.interp(dim=.75) <xarray.DataArray ()> array(1.5) Coordinates: nondim float64 0.5 dim float64 0.75 da.interp(nondim=.5) Traceback (most recent call last):

File "<ipython-input-192-e3df34cff90f>", line 1, in <module> da.interp(nondim=.5)

File "/usr/lib64/python3.6/site-packages/xarray/core/dataarray.py", line 951, in interp **coords_kwargs)

File "/usr/lib64/python3.6/site-packages/xarray/core/dataset.py", line 1860, in interp indexers = OrderedDict(self._validate_indexers(coords))

File "/usr/lib64/python3.6/site-packages/xarray/core/dataset.py", line 1316, in _validate_indexers raise ValueError("dimensions %r do not exist" % invalid)

ValueError: dimensions ['nondim'] do not exist ```

Expected Output

The same interpolation as for 'dim'.

Problem Description

Apparently, xarray currently cannot interpolate using non-dimension coordinates.

Output of xr.show_versions()

commit: None python: 3.6.5.final.0 python-bits: 64 OS: Linux OS-release: 4.19.72-gentoo machine: x86_64 processor: Intel(R) Core(TM) i7-2620M CPU @ 2.70GHz byteorder: little LC_ALL: None LANG: nl_BE.UTF-8 LOCALE: nl_BE.UTF-8 xarray: 0.10.8 pandas: 0.24.2 numpy: 1.14.5 scipy: 1.1.0 netCDF4: 1.5.1.2 h5netcdf: None h5py: 2.9.0 Nio: None zarr: None bottleneck: 1.2.1 cyordereddict: None dask: 1.2.0 distributed: None matplotlib: 2.2.2 cartopy: None seaborn: None setuptools: 40.6.3 pip: 19.1 conda: None pytest: 3.10.1 IPython: 5.4.1 sphinx: 1.7.5
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3343/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 issue

Links from other tables

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