pandas / 0.25.0 / reference / api / pandas.timestamp.ceil.html /

pandas.Timestamp.ceil

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

return a new Timestamp ceiled to this resolution

Parameters:
freq : a freq string indicating the ceiling resolution
ambiguous : bool, ‘NaT’, default ‘raise’
  • bool contains flags to determine if time is dst or not (note that this flag is only applicable for ambiguous fall dst dates)
  • ‘NaT’ will return NaT for an ambiguous time
  • ‘raise’ will raise an AmbiguousTimeError for an ambiguous time

New in version 0.24.0.

nonexistent : ‘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.

  • ‘shift_forward’ will shift the nonexistent time forward to the closest existing time
  • ‘shift_backward’ will shift the nonexistent time backward to the closest existing time
  • ‘NaT’ will return NaT where there are nonexistent times
  • timedelta objects will shift nonexistent times by the timedelta
  • ‘raise’ will raise an NonExistentTimeError if there are nonexistent times

New in version 0.24.0.

Raises:
ValueError if the freq cannot be converted

© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/0.25.0/reference/api/pandas.Timestamp.ceil.html