From 93112003b0c2422b95a9c650d3789b749b5e286a Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Sun, 2 Apr 2023 07:20:09 -0700 Subject: [PATCH] Backport PR #52311: DOC: Clarify Timestamp(unit=) will not necessarily set unit --- pandas/_libs/tslibs/timestamps.pyx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandas/_libs/tslibs/timestamps.pyx b/pandas/_libs/tslibs/timestamps.pyx index 2134da209246e..6b707d4158f6c 100644 --- a/pandas/_libs/tslibs/timestamps.pyx +++ b/pandas/_libs/tslibs/timestamps.pyx @@ -1290,6 +1290,9 @@ class Timestamp(_Timestamp): Unit used for conversion if ts_input is of type int or float. The valid values are 'D', 'h', 'm', 's', 'ms', 'us', and 'ns'. For example, 's' means seconds and 'ms' means milliseconds. + + For float inputs, the result will be stored in nanoseconds, and + the unit attribute will be set as ``'ns'``. fold : {0, 1}, default None, keyword-only Due to daylight saving time, one wall clock time can occur twice when shifting from summer to winter time; fold describes whether the