pandas.Series.dt.unit#
- Series.dt.unit[source] #
The precision unit of the datetime data.
Returns the precision unit for the dtype. It means the smallest time frame that can be stored within this dtype.
- Returns:
- str
Unit string representation (e.g. "ns").
See also
TimelikeOps.as_unit
Converts to a specific unit.
Examples
>>> idx = pd.DatetimeIndex(["2020年01月02日 01:02:03.004005006"]) >>> idx.unit 'ns' >>> idx.as_unit("s").unit 's'