Skip to content

Commit 1a9a43d

Browse files
DOC: add SA01 ES01 for pandas.Timestamp.tz_convert and pandas.Timestamp.astimezone (#58757)
DOC: add SA01 for pandas.Timestamp.tz_convert
1 parent 2753b17 commit 1a9a43d

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

ci/code_checks.sh

-2
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
246246
-i "pandas.TimedeltaIndex.nanoseconds SA01" \
247247
-i "pandas.TimedeltaIndex.seconds SA01" \
248248
-i "pandas.TimedeltaIndex.to_pytimedelta RT03,SA01" \
249-
-i "pandas.Timestamp.astimezone SA01" \
250249
-i "pandas.Timestamp.ceil SA01" \
251250
-i "pandas.Timestamp.combine PR01,SA01" \
252251
-i "pandas.Timestamp.ctime SA01" \
@@ -284,7 +283,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
284283
-i "pandas.Timestamp.today SA01" \
285284
-i "pandas.Timestamp.toordinal SA01" \
286285
-i "pandas.Timestamp.tz SA01" \
287-
-i "pandas.Timestamp.tz_convert SA01" \
288286
-i "pandas.Timestamp.tz_localize SA01" \
289287
-i "pandas.Timestamp.tzinfo GL08" \
290288
-i "pandas.Timestamp.tzname SA01" \

pandas/_libs/tslibs/nattype.pyx

+24
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,11 @@ class NaTType(_NaT):
822822
"""
823823
Convert timezone-aware Timestamp to another time zone.
824824
825+
This method is used to convert a timezone-aware Timestamp object to a
826+
different time zone. The original UTC time remains the same; only the
827+
time zone information is changed. If the Timestamp is timezone-naive, a
828+
TypeError is raised.
829+
825830
Parameters
826831
----------
827832
tz : str, pytz.timezone, dateutil.tz.tzfile or None
@@ -837,6 +842,13 @@ class NaTType(_NaT):
837842
TypeError
838843
If Timestamp is tz-naive.
839844
845+
See Also
846+
--------
847+
Timestamp.tz_localize : Localize the Timestamp to a timezone.
848+
DatetimeIndex.tz_convert : Convert a DatetimeIndex to another time zone.
849+
DatetimeIndex.tz_localize : Localize a DatetimeIndex to a specific time zone.
850+
datetime.datetime.astimezone : Convert a datetime object to another time zone.
851+
840852
Examples
841853
--------
842854
Create a timestamp object with UTC timezone:
@@ -1264,6 +1276,11 @@ timedelta}, default 'raise'
12641276
"""
12651277
Convert timezone-aware Timestamp to another time zone.
12661278
1279+
This method is used to convert a timezone-aware Timestamp object to a
1280+
different time zone. The original UTC time remains the same; only the
1281+
time zone information is changed. If the Timestamp is timezone-naive, a
1282+
TypeError is raised.
1283+
12671284
Parameters
12681285
----------
12691286
tz : str, pytz.timezone, dateutil.tz.tzfile or None
@@ -1279,6 +1296,13 @@ timedelta}, default 'raise'
12791296
TypeError
12801297
If Timestamp is tz-naive.
12811298
1299+
See Also
1300+
--------
1301+
Timestamp.tz_localize : Localize the Timestamp to a timezone.
1302+
DatetimeIndex.tz_convert : Convert a DatetimeIndex to another time zone.
1303+
DatetimeIndex.tz_localize : Localize a DatetimeIndex to a specific time zone.
1304+
datetime.datetime.astimezone : Convert a datetime object to another time zone.
1305+
12821306
Examples
12831307
--------
12841308
Create a timestamp object with UTC timezone:

pandas/_libs/tslibs/timestamps.pyx

+12
Original file line numberDiff line numberDiff line change
@@ -2470,6 +2470,11 @@ default 'raise'
24702470
"""
24712471
Convert timezone-aware Timestamp to another time zone.
24722472
2473+
This method is used to convert a timezone-aware Timestamp object to a
2474+
different time zone. The original UTC time remains the same; only the
2475+
time zone information is changed. If the Timestamp is timezone-naive, a
2476+
TypeError is raised.
2477+
24732478
Parameters
24742479
----------
24752480
tz : str, pytz.timezone, dateutil.tz.tzfile or None
@@ -2485,6 +2490,13 @@ default 'raise'
24852490
TypeError
24862491
If Timestamp is tz-naive.
24872492
2493+
See Also
2494+
--------
2495+
Timestamp.tz_localize : Localize the Timestamp to a timezone.
2496+
DatetimeIndex.tz_convert : Convert a DatetimeIndex to another time zone.
2497+
DatetimeIndex.tz_localize : Localize a DatetimeIndex to a specific time zone.
2498+
datetime.datetime.astimezone : Convert a datetime object to another time zone.
2499+
24882500
Examples
24892501
--------
24902502
Create a timestamp object with UTC timezone:

0 commit comments

Comments
 (0)