A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pandas.pydata.org/pandas-docs/stable/reference/api/../api/pandas.Timestamp.as_unit.html below:

pandas.Timestamp.as_unit — pandas 2.3.1 documentation

pandas.Timestamp.as_unit#
Timestamp.as_unit(unit, round_ok=True)#

Convert the underlying int64 representaton to the given unit.

Parameters:
unit{“ns”, “us”, “ms”, “s”}
round_okbool, default True

If False and the conversion requires rounding, raise.

Returns:
Timestamp

Examples

>>> ts = pd.Timestamp('2023-01-01 00:00:00.01')
>>> ts
Timestamp('2023-01-01 00:00:00.010000')
>>> ts.unit
'ms'
>>> ts = ts.as_unit('s')
>>> ts
Timestamp('2023-01-01 00:00:00')
>>> ts.unit
's'

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4