Skip to content

DOC: document non-inclusive slicing on DatetimeIndex#64323

Open
yoginlangalia wants to merge 1 commit intopandas-dev:mainfrom
yoginlangalia:doc-noninclusive-slicing
Open

DOC: document non-inclusive slicing on DatetimeIndex#64323
yoginlangalia wants to merge 1 commit intopandas-dev:mainfrom
yoginlangalia:doc-noninclusive-slicing

Conversation

@yoginlangalia
Copy link

Adds a "Non-inclusive slicing" subsection to the time series user guide (doc/source/user_guide/timeseries.rst) documenting how to perform exclusive-endpoint queries on a DatetimeIndex, since label-based slicing always includes both endpoints.

Covers two approaches:

  • Boolean indexing for open and half-open intervals
  • Index.get_slice_bound with .iloc for efficient non-inclusive slicing on sorted indices

This was suggested by @TomAugspurger in the original issue as a documentation improvement.

Adds a "Non-inclusive slicing" subsection to the time series user guide
documenting how to perform exclusive-endpoint queries on a DatetimeIndex,
since label-based slicing always includes both endpoints.

Covers two approaches:
- Boolean indexing for open and half-open intervals
- Index.get_slice_bound with .iloc for efficient non-inclusive
  slicing on sorted indices
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant