pyspark.pandas.Series.at_time

Series.at_time(time: Union[datetime.time, str], asof: bool = False, axis: Union[int, str] = 0) → pyspark.pandas.series.Series

Select values at particular time of day (example: 9:30AM).

Parameters
timedatetime.time or str
axis{0 or ‘index’, 1 or ‘columns’}, default 0
Returns
Series
Raises
TypeError

If the index is not a DatetimeIndex

See also

between_time

Select values between particular times of the day.

DatetimeIndex.indexer_at_time

Get just the index locations for values at particular time of the day.

Examples

>>> idx = pd.date_range('2018-04-09', periods=4, freq='12H')
>>> psser = ps.Series([1, 2, 3, 4], index=idx)
>>> psser
2018-04-09 00:00:00    1
2018-04-09 12:00:00    2
2018-04-10 00:00:00    3
2018-04-10 12:00:00    4
dtype: int64
>>> psser.at_time('12:00')
2018-04-09 12:00:00    2
2018-04-10 12:00:00    4
dtype: int64