Skip to content

Commit 6244320

Browse files
committed
updating NaT docstrings to match for timestamps
1 parent 51def5b commit 6244320

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

pandas/_libs/tslibs/nattype.pyx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,13 @@ class NaTType(_NaT):
626626
"""
627627
Return time zone name.
628628
629+
This method returns the name of the Timestamp's time zone as a string.
630+
631+
See Also
632+
--------
633+
Timestamp.tzinfo : Returns the timezone information of the Timestamp.
634+
Timestamp.tz_convert : Convert timezone-aware Timestamp to another time zone.
635+
629636
Examples
630637
--------
631638
>>> ts = pd.Timestamp('2023-01-01 10:00:00', tz='Europe/Brussels')
@@ -765,6 +772,21 @@ class NaTType(_NaT):
765772
766773
Construct a timezone-aware UTC datetime from a POSIX timestamp.
767774
775+
This method creates a datetime object from a POSIX timestamp, keeping the
776+
Timestamp object's timezone.
777+
778+
Parameters
779+
----------
780+
ts : float
781+
POSIX timestamp.
782+
783+
See Also
784+
--------
785+
Timezone.tzname : Return time zone name.
786+
Timestamp.utcnow : Return a new Timestamp representing UTC day and time.
787+
Timestamp.fromtimestamp : Transform timestamp[, tz] to tz's local
788+
time from POSIX timestamp.
789+
768790
Notes
769791
-----
770792
Timestamp.utcfromtimestamp behavior differs from datetime.utcfromtimestamp
@@ -1432,6 +1454,13 @@ default 'raise'
14321454
TypeError
14331455
If the Timestamp is tz-aware and tz is not None.
14341456
1457+
See Also
1458+
--------
1459+
Timestamp.tzinfo : Returns the timezone information of the Timestamp.
1460+
Timestamp.tz_convert : Convert timezone-aware Timestamp to another time zone.
1461+
DatetimeIndex.tz_localize : Localize a DatetimeIndex to a specific time zone.
1462+
datetime.datetime.astimezone : Convert a datetime object to another time zone.
1463+
14351464
Examples
14361465
--------
14371466
Create a naive timestamp object:

0 commit comments

Comments
 (0)