From 5e5fa3f8f663eca97e7a6549a3bf33f72dd77c51 Mon Sep 17 00:00:00 2001 From: Will Sorenson Date: Mon, 22 Jan 2024 12:09:32 -0800 Subject: [PATCH 1/3] ambiguous takes bool as an argument, not bool-ndarray ambiguous takes bool as an argument, not bool-ndarray --- pandas/core/generic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 2fe1f4a3bcf7c..d3c8568c8f0f9 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -11586,7 +11586,7 @@ def tz_localize( You can already get the future behavior and improvements through enabling copy on write ``pd.options.mode.copy_on_write = True`` - ambiguous : 'infer', bool-ndarray, 'NaT', default 'raise' + ambiguous : 'infer', bool, 'NaT', default 'raise' When clocks moved backward due to DST, ambiguous times may arise. For example in Central European Time (UTC+01), when going from 03:00 DST to 02:00 non-DST, 02:30:00 local time occurs both at @@ -11596,7 +11596,7 @@ def tz_localize( - 'infer' will attempt to infer fall dst-transition hours based on order - - bool-ndarray where True signifies a DST time, False designates + - bool where True signifies a DST time, False designates a non-DST time (note that this flag is only applicable for ambiguous times) - 'NaT' will return NaT where there are ambiguous times From fed75a587d15e71a804251e34352ffe50770f294 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Mon, 29 Jan 2024 11:49:08 +0700 Subject: [PATCH 2/3] Update pandas/core/generic.py Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> --- pandas/core/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index d3c8568c8f0f9..ec4fa707f0de6 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -11586,7 +11586,7 @@ def tz_localize( You can already get the future behavior and improvements through enabling copy on write ``pd.options.mode.copy_on_write = True`` - ambiguous : 'infer', bool, 'NaT', default 'raise' + ambiguous : 'infer', bool, bool-ndarray, 'NaT', default 'raise' When clocks moved backward due to DST, ambiguous times may arise. For example in Central European Time (UTC+01), when going from 03:00 DST to 02:00 non-DST, 02:30:00 local time occurs both at From d6569866cb373a05431f4f0bc3a1efc984a3d122 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Mon, 29 Jan 2024 11:49:16 +0700 Subject: [PATCH 3/3] Update pandas/core/generic.py Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> --- pandas/core/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index ec4fa707f0de6..5868975390516 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -11596,7 +11596,7 @@ def tz_localize( - 'infer' will attempt to infer fall dst-transition hours based on order - - bool where True signifies a DST time, False designates + - bool (or bool-ndarray) where True signifies a DST time, False designates a non-DST time (note that this flag is only applicable for ambiguous times) - 'NaT' will return NaT where there are ambiguous times