From c6923c8afa4b838e23f7dd40a16f228b5c8e2ba0 Mon Sep 17 00:00:00 2001 From: "Dr. Jan-Philip Gehrcke" Date: Wed, 14 Apr 2021 12:53:53 +0200 Subject: [PATCH 1/2] DOC: fix tz (un)aware logic in tz_localize() docstring --- pandas/core/arrays/datetimes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index 1be2ec0dd92d7..f08803ca70594 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -857,8 +857,8 @@ def tz_localize(self, tz, ambiguous="raise", nonexistent="raise") -> DatetimeArr This method takes a time zone (tz) naive Datetime Array/Index object and makes this time zone aware. It does not move the time to another time zone. - Time zone localization helps to switch from time zone aware to time - zone unaware objects. + Time zone localization helps to switch from time zone unaware to time + zone aware objects. Parameters ---------- From 4ffb6d1d1d9eb1af1a995c694b81e361c0342c88 Mon Sep 17 00:00:00 2001 From: "Dr. Jan-Philip Gehrcke" Date: Fri, 16 Apr 2021 12:18:52 +0200 Subject: [PATCH 2/2] DOC: fix tz (un)aware logic in tz_localize() docstring --- pandas/core/arrays/datetimes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index f08803ca70594..06ff6ffa61559 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -857,8 +857,9 @@ def tz_localize(self, tz, ambiguous="raise", nonexistent="raise") -> DatetimeArr This method takes a time zone (tz) naive Datetime Array/Index object and makes this time zone aware. It does not move the time to another time zone. - Time zone localization helps to switch from time zone unaware to time - zone aware objects. + + This method can also be used to do the inverse -- to create a time + zone unaware object from an aware object. To that end, pass `tz=None`. Parameters ----------