Convert the underlying int64 representation to the given unit.
If False and the conversion requires rounding, raise.
Examples
>>> td = pd.Timedelta('1001ms')
>>> td
Timedelta('0 days 00:00:01.001000')
>>> td.as_unit('s')
Timedelta('0 days 00:00:01')
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.Timedelta.as_unit.html