From af8be1d958de3b24955963bee8ea63e60ace1407 Mon Sep 17 00:00:00 2001 From: MeeseeksMachine <39504233+meeseeksmachine@users.noreply.github.com> Date: Sun, 2 Apr 2023 19:04:24 +0200 Subject: [PATCH] Backport PR #52311 on branch 2.0.x (DOC: Clarify Timestamp(unit=) will not necessarily set unit) (#52360) Backport PR #52311: DOC: Clarify Timestamp(unit=) will not necessarily set unit Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> --- 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