Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Alternatives

There are two alternative solutions already built into xarray for solving the problems of this package.

You have time series data with metadata that spans intervals of time (e.g., words spoken during a recording). You want to:

  1. Select data by time range

  2. Select data by metadata (e.g., “give me all data during word X”)

  3. Keep the time and metadata dimensions synchronized

ApproachProsCons
Direct CoordsSimple to understand; works with standard xarrayMust construct dense arrays; loses interval boundary info; no isel by metadata
MultiIndexBuilt-in pandas/xarray support; familiar APIAwkward slicing behavior; duplicates time values; can’t easily get interval boundaries
Linked Indices (this library)Preserves interval structure; automatic cross-slicing; natural representationRequires custom Index; newer xarray feature

If either of MultiIndex or direct coords works for your use case then you should prefer to use them over this custom index.

Use MultiIndex when:

Use Direct Coords when:

Use Linked Indices when:

Detailed Examples