pandas.Timestamp.floor — pandas 1.0.5 documentation (original) (raw)

Timestamp. floor(self, freq, ambiguous='raise', nonexistent='raise')

return a new Timestamp floored to this resolution.

Parameters

freqstr

Frequency string indicating the flooring resolution.

ambiguousbool or {‘raise’, ‘NaT’}, default ‘raise’

The behavior is as follows:

New in version 0.24.0.

nonexistent{‘raise’, ‘shift_forward’, ‘shift_backward, ‘NaT’, timedelta}, default ‘raise’

A nonexistent time does not exist in a particular timezone where clocks moved forward due to DST.

New in version 0.24.0.

Raises

ValueError if the freq cannot be converted.