Skip to main content
`Ctrl`+`K`

# pandas.Timedelta.ceil

Timedelta.ceil(freq)

  Return a new Timedelta ceiled to this resolution.

  Rounds the Timedelta up to the nearest multiple of the given frequency, rounding toward positive infinity.

  Parameters:
    freq str

      Frequency string indicating the ceiling resolution. Must be a fixed frequency like ‘s’ (second) not ‘ME’ (month end). See frequency aliases for a list of possible freq values.

  Returns:
    Timedelta

      A new Timedelta object ceiled to the specified resolution.

  See also

  `Timedelta.floor`

    Floor the Timedelta to the specified resolution.

  `Timedelta.round`

    Round the Timedelta to the nearest specified resolution.

  Examples

      >>> td = pd.Timedelta('1001ms')
      >>> td
      Timedelta('0 days 00:00:01.001000')
      >>> td.ceil('s')
      Timedelta('0 days 00:00:02')