pyspark.pandas.DataFrame.at_time

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

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
DataFrame
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')
>>> psdf = ps.DataFrame({'A': [1, 2, 3, 4]}, index=idx)
>>> psdf
                     A
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
>>> psdf.at_time('12:00')
                     A
2018-04-09 12:00:00  2
2018-04-10 12:00:00  4