pandas.DatetimeIndex.indexer_between_time

pandas 3.1.1 · Index objects · method

Find integer positions between two clock times in a DatetimeIndex.

Call syntax

DatetimeIndex.indexer_between_time(start_time, end_time, include_start=True, include_end=True)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
start_time Required
Positional or keyword
datetime.time, str

Set the first clock time considered for a time-of-day selection.

end_time Required
Positional or keyword
datetime.time, str

Set the last clock time considered for a time-of-day selection.

include_start Optional
Positional or keyword
Default True
bool
include_end Optional
Positional or keyword
Default True
bool

Returns

np.ndarray[np.intp]