Skip to content

Automatically create xindex#11029

Merged
max-sixty merged 12 commits intopydata:mainfrom
ianhi:auto-xindex
Dec 18, 2025
Merged

Automatically create xindex#11029
max-sixty merged 12 commits intopydata:mainfrom
ianhi:auto-xindex

Conversation

@ianhi
Copy link
Collaborator

@ianhi ianhi commented Dec 17, 2025

Closes: #9703

allows .sel to automatically create a PandasIndex object for if one is not present.

import xarray as xr
ds = xr.Dataset(
    {"data":('time', [0,1,2,3])},
    coords={"time":[.1, .2, .3, .4], 'time_metadata':('time', [10,15,20,25])}
)
ds
# both these work and are equivalent
ds.sel(time=.2)
ds.sel(time_metadata=15)
  • Closes #xxxx
  • Tests added
  • User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [NA] New functions/methods are listed in api.rst

@max-sixty @benbovy

Copy link
Member

@benbovy benbovy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks @ianhi.

@max-sixty
Copy link
Collaborator

super, thanks @ianhi !

@max-sixty max-sixty added the plan to merge Final call for comments label Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plan to merge Final call for comments topic-indexing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatically create xindex?

3 participants