home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 467267153

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
467267153 MDU6SXNzdWU0NjcyNjcxNTM= 3099 Interpolation doesn't apply on time coordinate 4711805 closed 0     1 2019-07-12T07:37:18Z 2019-07-13T15:05:39Z 2019-07-13T15:05:39Z CONTRIBUTOR      

MCVE Code Sample

```python In [1]: import numpy as np ...: import pandas as pd ...: import xarray as xr

In [2]: da = xr.DataArray([1, 2], [('time', pd.date_range('2000-01-01', '2000-01-02', periods=2))]) ...: da
Out[2]: <xarray.DataArray (time: 2)> array([1, 2]) Coordinates: * time (time) datetime64[ns] 2000-01-01 2000-01-02

In [3]: da.interp(time=da.time-np.timedelta64(1, 'D'))
Out[3]: <xarray.DataArray (time: 2)> array([nan, 1.]) Coordinates: * time (time) datetime64[ns] 2000-01-01 2000-01-02 ```

Problem Description

The data has been interpolated, but not the time coordinate.

Expected Output

When we explicitly get the values of the time coordinate, it works fine:

python In [4]: da.interp(time=da.time.values-np.timedelta64(1, 'D')) Out[4]: <xarray.DataArray (time: 2)> array([nan, 1.]) Coordinates: * time (time) datetime64[ns] 1999-12-31 2000-01-01

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.7.3 (default, Mar 27 2019, 22:11:17) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 4.10.0-42-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: None libnetcdf: None xarray: 0.12.2 pandas: 0.24.2 numpy: 1.16.4 scipy: 1.2.1 netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: 2.3.2 cftime: None nc_time_axis: None PseudonetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2.0.0 distributed: 2.0.1 matplotlib: 3.1.0 cartopy: None seaborn: None numbagg: None setuptools: 41.0.0 pip: 19.0.3 conda: 4.7.5 pytest: None IPython: 7.7.0.dev sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3099/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

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