home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 522402552

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
522402552 MDU6SXNzdWU1MjI0MDI1NTI= 3522 CFTimeIndex changes to normal Index after renaming 15331990 closed 0     3 2019-11-13T18:42:02Z 2019-11-15T19:49:30Z 2019-11-15T19:49:30Z CONTRIBUTOR      

MCVE Code Sample

Since this code crashes for me and I don't have xarray master, I can't create a tested MCVE Code sample at the moment, but I think something along the lines of: python import xarray as xr ds = xr.Dataset(coords={'time': xr.cftime_range(start='2000', periods=6, freq='2MS', calendar='noleap'), 'something': [0, 1, 2, 3]}) print(ds.indexes['time']) ds = ds.rename({'something': 'something_else'}) print(ds.indexes['time'])

Expected Output

CFTimeIndex([2000-05-01 12:00:00, 2000-05-02 12:00:00, ... 2001-04-01 12:00:00], dtype='object', name='time', length=425) After renaming Index([2000-05-01 12:00:00, 2000-05-02 12:00:00, ... 2001-04-01 12:00:00], dtype='object', name='time', length=425)

Problem Description

CFTimeIndex changes to normal Index after renaming

Output of xr.show_versions()

xarray: 0.14.0 pandas: 0.25.2 numpy: 1.17.2 scipy: 1.3.1 netCDF4: 1.5.3 pydap: None h5netcdf: 0.7.4 h5py: 2.9.0 Nio: None zarr: None cftime: 1.0.4.2 nc_time_axis: None PseudoNetCDF: None rasterio: 1.1.0 cfgrib: None iris: None bottleneck: 1.2.1 dask: 2.6.0 distributed: 2.6.0 matplotlib: 3.1.1 cartopy: 0.17.0 seaborn: None numbagg: None setuptools: 41.4.0 pip: 19.3.1 conda: None pytest: 5.2.1 IPython: 7.9.0 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3522/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 0.571ms · About: xarray-datasette