From 4ceb5add390d247de2c6dae8b93d885de0dac81b Mon Sep 17 00:00:00 2001 From: luke <2736230899@qq.com> Date: Sat, 14 Jan 2023 15:32:00 +0800 Subject: [PATCH] add datetime.tzinfo to paramater tz --- 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 f1da99825d5fd..2c1ef7f05fa03 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -803,7 +803,7 @@ def tz_convert(self, tz) -> DatetimeArray: Parameters ---------- - tz : str, pytz.timezone, dateutil.tz.tzfile or None + tz : str, pytz.timezone, dateutil.tz.tzfile, datetime.tzinfo or None Time zone for time. Corresponding timestamps would be converted to this time zone of the Datetime Array/Index. A `tz` of None will convert to UTC and remove the timezone information. @@ -892,7 +892,7 @@ def tz_localize( Parameters ---------- - tz : str, pytz.timezone, dateutil.tz.tzfile or None + tz : str, pytz.timezone, dateutil.tz.tzfile, datetime.tzinfo or None Time zone to convert timestamps to. Passing ``None`` will remove the time zone information preserving local time. ambiguous : 'infer', 'NaT', bool array, default 'raise'