@@ -396,7 +396,7 @@ class NaTType(_NaT):
396
396
Parameters
397
397
----------
398
398
locale : string, default None (English locale)
399
- locale determining the language in which to return the month name
399
+ Locale determining the language in which to return the month name.
400
400
401
401
Returns
402
402
-------
@@ -411,7 +411,7 @@ class NaTType(_NaT):
411
411
Parameters
412
412
----------
413
413
locale : string, default None (English locale)
414
- locale determining the language in which to return the day name
414
+ Locale determining the language in which to return the day name.
415
415
416
416
Returns
417
417
-------
@@ -509,11 +509,11 @@ class NaTType(_NaT):
509
509
Parameters
510
510
----------
511
511
ordinal : int
512
- date corresponding to a proleptic Gregorian ordinal
512
+ Date corresponding to a proleptic Gregorian ordinal.
513
513
freq : str, DateOffset
514
- Offset which Timestamp will have
514
+ Offset to apply to the Timestamp.
515
515
tz : str, pytz.timezone, dateutil.tz.tzfile or None
516
- Time zone for time which Timestamp will have .
516
+ Time zone for the Timestamp.
517
517
""" )
518
518
519
519
# _nat_methods
@@ -534,7 +534,7 @@ class NaTType(_NaT):
534
534
Parameters
535
535
----------
536
536
tz : str or timezone object, default None
537
- Timezone to localize to
537
+ Timezone to localize to.
538
538
""" )
539
539
today = _make_nat_func(' today' , # noqa:E128
540
540
"""
@@ -547,35 +547,38 @@ class NaTType(_NaT):
547
547
Parameters
548
548
----------
549
549
tz : str or timezone object, default None
550
- Timezone to localize to
550
+ Timezone to localize to.
551
551
""" )
552
552
round = _make_nat_func(' round' , # noqa:E128
553
553
"""
554
554
Round the Timestamp to the specified resolution.
555
555
556
556
Parameters
557
557
----------
558
- freq : a freq string indicating the rounding resolution
559
- ambiguous : bool, 'NaT', default 'raise'
560
- - bool contains flags to determine if time is dst or not (note
561
- that this flag is only applicable for ambiguous fall dst dates)
562
- - 'NaT' will return NaT for an ambiguous time
563
- - 'raise' will raise an AmbiguousTimeError for an ambiguous time
558
+ freq : str
559
+ Frequency string indicating the rounding resolution.
560
+ ambiguous : bool or {'raise', 'NaT'}, default 'raise'
561
+ The behavior is as follows:
562
+
563
+ * bool contains flags to determine if time is dst or not (note
564
+ that this flag is only applicable for ambiguous fall dst dates).
565
+ * 'NaT' will return NaT for an ambiguous time.
566
+ * 'raise' will raise an AmbiguousTimeError for an ambiguous time.
564
567
565
568
.. versionadded:: 0.24.0
566
- nonexistent : ' shift_forward', 'shift_backward, 'NaT', timedelta , \
567
- default 'raise'
569
+ nonexistent : {'raise', ' shift_forward', 'shift_backward, 'NaT', \
570
+ timedelta}, default 'raise'
568
571
A nonexistent time does not exist in a particular timezone
569
572
where clocks moved forward due to DST.
570
573
571
- - 'shift_forward' will shift the nonexistent time forward to the
572
- closest existing time
573
- - 'shift_backward' will shift the nonexistent time backward to the
574
- closest existing time
575
- - 'NaT' will return NaT where there are nonexistent times
576
- - timedelta objects will shift nonexistent times by the timedelta
577
- - 'raise' will raise an NonExistentTimeError if there are
578
- nonexistent times
574
+ * 'shift_forward' will shift the nonexistent time forward to the
575
+ closest existing time.
576
+ * 'shift_backward' will shift the nonexistent time backward to the
577
+ closest existing time.
578
+ * 'NaT' will return NaT where there are nonexistent times.
579
+ * timedelta objects will shift nonexistent times by the timedelta.
580
+ * 'raise' will raise an NonExistentTimeError if there are
581
+ nonexistent times.
579
582
580
583
.. versionadded:: 0.24.0
581
584
@@ -593,67 +596,73 @@ default 'raise'
593
596
594
597
Parameters
595
598
----------
596
- freq : a freq string indicating the flooring resolution
597
- ambiguous : bool, 'NaT', default 'raise'
598
- - bool contains flags to determine if time is dst or not (note
599
- that this flag is only applicable for ambiguous fall dst dates)
600
- - 'NaT' will return NaT for an ambiguous time
601
- - 'raise' will raise an AmbiguousTimeError for an ambiguous time
599
+ freq : str
600
+ Frequency string indicating the flooring resolution.
601
+ ambiguous : bool or {'raise', 'NaT'}, default 'raise'
602
+ The behavior is as follows:
603
+
604
+ * bool contains flags to determine if time is dst or not (note
605
+ that this flag is only applicable for ambiguous fall dst dates).
606
+ * 'NaT' will return NaT for an ambiguous time.
607
+ * 'raise' will raise an AmbiguousTimeError for an ambiguous time.
602
608
603
609
.. versionadded:: 0.24.0
604
- nonexistent : ' shift_forward', 'shift_backward, 'NaT', timedelta , \
605
- default 'raise'
610
+ nonexistent : {'raise', ' shift_forward', 'shift_backward, 'NaT', \
611
+ timedelta}, default 'raise'
606
612
A nonexistent time does not exist in a particular timezone
607
613
where clocks moved forward due to DST.
608
614
609
- - 'shift_forward' will shift the nonexistent time forward to the
610
- closest existing time
611
- - 'shift_backward' will shift the nonexistent time backward to the
612
- closest existing time
613
- - 'NaT' will return NaT where there are nonexistent times
614
- - timedelta objects will shift nonexistent times by the timedelta
615
- - 'raise' will raise an NonExistentTimeError if there are
616
- nonexistent times
615
+ * 'shift_forward' will shift the nonexistent time forward to the
616
+ closest existing time.
617
+ * 'shift_backward' will shift the nonexistent time backward to the
618
+ closest existing time.
619
+ * 'NaT' will return NaT where there are nonexistent times.
620
+ * timedelta objects will shift nonexistent times by the timedelta.
621
+ * 'raise' will raise an NonExistentTimeError if there are
622
+ nonexistent times.
617
623
618
624
.. versionadded:: 0.24.0
619
625
620
626
Raises
621
627
------
622
- ValueError if the freq cannot be converted
628
+ ValueError if the freq cannot be converted.
623
629
""" )
624
630
ceil = _make_nat_func(' ceil' , # noqa:E128
625
631
"""
626
632
return a new Timestamp ceiled to this resolution.
627
633
628
634
Parameters
629
635
----------
630
- freq : a freq string indicating the ceiling resolution
631
- ambiguous : bool, 'NaT', default 'raise'
632
- - bool contains flags to determine if time is dst or not (note
633
- that this flag is only applicable for ambiguous fall dst dates)
634
- - 'NaT' will return NaT for an ambiguous time
635
- - 'raise' will raise an AmbiguousTimeError for an ambiguous time
636
+ freq : str
637
+ Frequency string indicating the ceiling resolution.
638
+ ambiguous : bool or {'raise', 'NaT'}, default 'raise'
639
+ The behavior is as follows:
640
+
641
+ * bool contains flags to determine if time is dst or not (note
642
+ that this flag is only applicable for ambiguous fall dst dates).
643
+ * 'NaT' will return NaT for an ambiguous time.
644
+ * 'raise' will raise an AmbiguousTimeError for an ambiguous time.
636
645
637
646
.. versionadded:: 0.24.0
638
- nonexistent : ' shift_forward', 'shift_backward, 'NaT', timedelta , \
639
- default 'raise'
647
+ nonexistent : {'raise', ' shift_forward', 'shift_backward, 'NaT', \
648
+ timedelta}, default 'raise'
640
649
A nonexistent time does not exist in a particular timezone
641
650
where clocks moved forward due to DST.
642
651
643
- - 'shift_forward' will shift the nonexistent time forward to the
644
- closest existing time
645
- - 'shift_backward' will shift the nonexistent time backward to the
646
- closest existing time
647
- - 'NaT' will return NaT where there are nonexistent times
648
- - timedelta objects will shift nonexistent times by the timedelta
649
- - 'raise' will raise an NonExistentTimeError if there are
650
- nonexistent times
652
+ * 'shift_forward' will shift the nonexistent time forward to the
653
+ closest existing time.
654
+ * 'shift_backward' will shift the nonexistent time backward to the
655
+ closest existing time.
656
+ * 'NaT' will return NaT where there are nonexistent times.
657
+ * timedelta objects will shift nonexistent times by the timedelta.
658
+ * 'raise' will raise an NonExistentTimeError if there are
659
+ nonexistent times.
651
660
652
661
.. versionadded:: 0.24.0
653
662
654
663
Raises
655
664
------
656
- ValueError if the freq cannot be converted
665
+ ValueError if the freq cannot be converted.
657
666
""" )
658
667
659
668
tz_convert = _make_nat_func(' tz_convert' , # noqa:E128
@@ -694,35 +703,42 @@ default 'raise'
694
703
`ambiguous` parameter dictates how ambiguous times should be
695
704
handled.
696
705
697
- - bool contains flags to determine if time is dst or not (note
698
- that this flag is only applicable for ambiguous fall dst dates)
699
- - 'NaT' will return NaT for an ambiguous time
700
- - 'raise' will raise an AmbiguousTimeError for an ambiguous time
706
+ The behavior is as follows:
707
+
708
+ * bool contains flags to determine if time is dst or not (note
709
+ that this flag is only applicable for ambiguous fall dst dates).
710
+ * 'NaT' will return NaT for an ambiguous time.
711
+ * 'raise' will raise an AmbiguousTimeError for an ambiguous time.
701
712
702
713
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \
703
714
default 'raise'
704
715
A nonexistent time does not exist in a particular timezone
705
716
where clocks moved forward due to DST.
706
717
707
- - 'shift_forward' will shift the nonexistent time forward to the
708
- closest existing time
709
- - 'shift_backward' will shift the nonexistent time backward to the
710
- closest existing time
711
- - 'NaT' will return NaT where there are nonexistent times
712
- - timedelta objects will shift nonexistent times by the timedelta
713
- - 'raise' will raise an NonExistentTimeError if there are
714
- nonexistent times
718
+ The behavior is as follows:
715
719
716
- .. versionadded:: 0.24.0
720
+ * 'shift_forward' will shift the nonexistent time forward to the
721
+ closest existing time.
722
+ * 'shift_backward' will shift the nonexistent time backward to the
723
+ closest existing time.
724
+ * 'NaT' will return NaT where there are nonexistent times.
725
+ * timedelta objects will shift nonexistent times by the timedelta.
726
+ * 'raise' will raise an NonExistentTimeError if there are
727
+ nonexistent times.
717
728
729
+ .. versionadded:: 0.24.0
718
730
errors : 'raise', 'coerce', default None
719
- - 'raise' will raise a NonExistentTimeError if a timestamp is not
720
- valid in the specified timezone (e.g. due to a transition from
721
- or to DST time). Use ``nonexistent='raise'`` instead.
722
- - 'coerce' will return NaT if the timestamp can not be converted
731
+ Determine how errors should be handled.
732
+
733
+ The behavior is as follows:
734
+
735
+ * 'raise' will raise a NonExistentTimeError if a timestamp is not
736
+ valid in the specified timezone (e.g. due to a transition from
737
+ or to DST time). Use ``nonexistent='raise'`` instead.
738
+ * 'coerce' will return NaT if the timestamp can not be converted
723
739
into the specified timezone. Use ``nonexistent='NaT'`` instead.
724
740
725
- .. deprecated:: 0.24.0
741
+ .. deprecated:: 0.24.0
726
742
727
743
Returns
728
744
-------
0 commit comments