@@ -953,7 +953,13 @@ cdef class _Timestamp(ABCTimestamp):
953
953
954
954
def normalize(self ) -> "Timestamp":
955
955
"""
956
- Normalize Timestamp to midnight , preserving tz information.
956
+ Normalize Timestamp to previous midnight , preserving tz information.
957
+
958
+ This is equivalent to replacing the time part of the timestamp with `00:00:00`.
959
+
960
+ See Also
961
+ --------
962
+ Timestamp.replace : Return a new timestamp with replaced attributes.
957
963
958
964
Examples
959
965
--------
@@ -1276,6 +1282,13 @@ cdef class _Timestamp(ABCTimestamp):
1276
1282
copy parameters are available here only for compatibility. Their values
1277
1283
will not affect the return value.
1278
1284
1285
+ Parameters
1286
+ ----------
1287
+ dtype : numpy.dtype , default None
1288
+ Must be None. Otherwise , a ValueError is raised.
1289
+ copy : bool , default False
1290
+ Must be False. Otherwise , a ValueError is raised.
1291
+
1279
1292
Returns
1280
1293
-------
1281
1294
numpy.datetime64
@@ -1303,7 +1316,20 @@ cdef class _Timestamp(ABCTimestamp):
1303
1316
1304
1317
def to_period(self , freq = None ):
1305
1318
"""
1306
- Return an period of which this timestamp is an observation.
1319
+ Return a period of which this timestamp is an observation.
1320
+
1321
+ This method constructs a `Period` object from the `Timestamp` and provided period.
1322
+ Please note that timezone information will be dropped, since `Period` doesn't support timezones.
1323
+
1324
+ Parameters
1325
+ ----------
1326
+ freq : str, default None
1327
+ The period frequency. Accepted strings are listed in the :ref:`period alias section <timeseries.period_aliases>` in the user docs.
1328
+
1329
+ See Also
1330
+ --------
1331
+ Period : Represents a period of time.
1332
+ Period.to_timestamp : Return the Timestamp representation of the Period.
1307
1333
1308
1334
Examples
1309
1335
--------
@@ -2603,23 +2629,42 @@ default 'raise'
2603
2629
"""
2604
2630
Implements datetime.replace, handles nanoseconds.
2605
2631
2632
+ Returns a new timestamp with the same attributes, except for those given new value.
2633
+
2606
2634
Parameters
2607
2635
----------
2608
2636
year : int, optional
2637
+ New year value.
2609
2638
month : int, optional
2639
+ New month value.
2610
2640
day : int, optional
2641
+ New day value.
2611
2642
hour : int, optional
2643
+ New hour value.
2612
2644
minute : int, optional
2645
+ New minute value.
2613
2646
second : int, optional
2647
+ New second value.
2614
2648
microsecond : int, optional
2649
+ New microsecond value.
2615
2650
nanosecond : int, optional
2651
+ New nanosecond value.
2616
2652
tzinfo : tz-convertible, optional
2653
+ New tzinfo value.
2617
2654
fold : int, optional
2655
+ New fold value.
2618
2656
2619
2657
Returns
2620
2658
-------
2621
2659
Timestamp with fields replaced
2622
2660
2661
+ See Also
2662
+ --------
2663
+ Timestamp.normalize : Normalize the Timestamp to midnight, preserving tz information.
2664
+ Timestamp.tz_convert : Convert timezone-aware Timestamp to another time zone.
2665
+ Timestamp.tz_localize : Localize the Timestamp to a timezone.
2666
+ datetime.datetime.replace : Return a new datetime with replaced attributes.
2667
+
2623
2668
Examples
2624
2669
--------
2625
2670
Create a timestamp object:
0 commit comments