pandas.DatetimeIndex.indexer_at_time — pandas 3.0.0.dev0+2104.ge637b4290d documentation (original) (raw)
DatetimeIndex.indexer_at_time(time, asof=False)[source]#
Return index locations of values at particular time of day.
Parameters:
timedatetime.time or str
Time passed in either as object (datetime.time) or as string in appropriate format (“%H:%M”, “%H%M”, “%I:%M%p”, “%I%M%p”, “%H:%M:%S”, “%H%M%S”, “%I:%M:%S%p”, “%I%M%S%p”).
asofbool, default False
This parameter is currently not supported.
Returns:
np.ndarray[np.intp]
Index locations of values at given time of day.
Examples
idx = pd.DatetimeIndex( ... ["1/1/2020 10:00", "2/1/2020 11:00", "3/1/2020 10:00"] ... ) idx.indexer_at_time("10:00") array([0, 2])