DatetimeIndex.
indexer_at_time
Return index locations of values at particular time of day (example: 9:30AM).
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”).
Examples
>>> psidx = ps.date_range("2000-01-01", periods=3, freq="T") >>> psidx DatetimeIndex(['2000-01-01 00:00:00', '2000-01-01 00:01:00', '2000-01-01 00:02:00'], dtype='datetime64[ns]', freq=None)
>>> psidx.indexer_at_time("00:00") Int64Index([0], dtype='int64')
>>> psidx.indexer_at_time("00:01") Int64Index([1], dtype='int64')