@@ -251,11 +251,11 @@ class Timestamp(_Timestamp):
251
251
Parameters
252
252
----------
253
253
ordinal : int
254
- date corresponding to a proleptic Gregorian ordinal
254
+ Date corresponding to a proleptic Gregorian ordinal.
255
255
freq : str, DateOffset
256
- Offset which Timestamp will have
256
+ Offset to apply to the Timestamp.
257
257
tz : str, pytz.timezone, dateutil.tz.tzfile or None
258
- Time zone for time which Timestamp will have .
258
+ Time zone for the Timestamp.
259
259
"""
260
260
return cls (datetime.fromordinal(ordinal),
261
261
freq = freq, tz = tz)
@@ -271,7 +271,7 @@ class Timestamp(_Timestamp):
271
271
Parameters
272
272
----------
273
273
tz : str or timezone object, default None
274
- Timezone to localize to
274
+ Timezone to localize to.
275
275
"""
276
276
if isinstance (tz, str ):
277
277
tz = maybe_get_tz(tz)
@@ -289,7 +289,7 @@ class Timestamp(_Timestamp):
289
289
Parameters
290
290
----------
291
291
tz : str or timezone object, default None
292
- Timezone to localize to
292
+ Timezone to localize to.
293
293
"""
294
294
return cls .now(tz)
295
295
@@ -445,29 +445,32 @@ class Timestamp(_Timestamp):
445
445
446
446
Parameters
447
447
----------
448
- freq : a freq string indicating the rounding resolution
449
- ambiguous : bool, 'NaT', default 'raise'
450
- - bool contains flags to determine if time is dst or not (note
451
- that this flag is only applicable for ambiguous fall dst dates)
452
- - 'NaT' will return NaT for an ambiguous time
453
- - 'raise' will raise an AmbiguousTimeError for an ambiguous time
454
-
455
- .. versionadded:: 0.24.0
456
- nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \
457
- default 'raise'
458
- A nonexistent time does not exist in a particular timezone
459
- where clocks moved forward due to DST.
460
-
461
- - 'shift_forward' will shift the nonexistent time forward to the
462
- closest existing time
463
- - 'shift_backward' will shift the nonexistent time backward to the
464
- closest existing time
465
- - 'NaT' will return NaT where there are nonexistent times
466
- - timedelta objects will shift nonexistent times by the timedelta
467
- - 'raise' will raise an NonExistentTimeError if there are
468
- nonexistent times
469
-
470
- .. versionadded:: 0.24.0
448
+ freq : str
449
+ Frequency string indicating the ceiling resolution.
450
+ ambiguous : {'raise', 'NaT', bool}, default 'raise'
451
+ The behavior is as follows:
452
+
453
+ * bool contains flags to determine if time is dst or not (note
454
+ that this flag is only applicable for ambiguous fall dst dates).
455
+ * 'NaT' will return NaT for an ambiguous time.
456
+ * 'raise' will raise an AmbiguousTimeError for an ambiguous time.
457
+
458
+ .. versionadded:: 0.24.0.
459
+ nonexistent : {'raise', 'shift_forward', 'shift_backward, 'NaT', \
460
+ timedelta}, default 'raise'
461
+ A nonexistent time does not exist in a particular timezone where
462
+ clocks moved forward due to DST.
463
+
464
+ * 'shift_forward' will shift the nonexistent time forward to the
465
+ closest existing time.
466
+ * 'shift_backward' will shift the nonexistent time backward to the
467
+ closest existing time.
468
+ * 'NaT' will return NaT where there are nonexistent times.
469
+ * timedelta objects will shift nonexistent times by the timedelta.
470
+ * 'raise' will raise an NonExistentTimeError if there are
471
+ nonexistent times.
472
+
473
+ .. versionadded:: 0.24.0.
471
474
472
475
Returns
473
476
-------
@@ -487,33 +490,36 @@ default 'raise'
487
490
488
491
Parameters
489
492
----------
490
- freq : a freq string indicating the flooring resolution
491
- ambiguous : bool, 'NaT', default 'raise'
492
- - bool contains flags to determine if time is dst or not (note
493
- that this flag is only applicable for ambiguous fall dst dates)
494
- - 'NaT' will return NaT for an ambiguous time
495
- - 'raise' will raise an AmbiguousTimeError for an ambiguous time
496
-
497
- .. versionadded:: 0.24.0
498
- nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \
499
- default 'raise'
500
- A nonexistent time does not exist in a particular timezone
501
- where clocks moved forward due to DST.
502
-
503
- - 'shift_forward' will shift the nonexistent time forward to the
504
- closest existing time
505
- - 'shift_backward' will shift the nonexistent time backward to the
506
- closest existing time
507
- - 'NaT' will return NaT where there are nonexistent times
508
- - timedelta objects will shift nonexistent times by the timedelta
509
- - 'raise' will raise an NonExistentTimeError if there are
510
- nonexistent times
511
-
512
- .. versionadded:: 0.24.0
493
+ freq : str
494
+ Frequency string indicating the ceiling resolution.
495
+ ambiguous : {'raise', 'NaT', bool}, default 'raise'
496
+ The behavior is as follows:
497
+
498
+ * bool contains flags to determine if time is dst or not (note
499
+ that this flag is only applicable for ambiguous fall dst dates).
500
+ * 'NaT' will return NaT for an ambiguous time.
501
+ * 'raise' will raise an AmbiguousTimeError for an ambiguous time.
502
+
503
+ .. versionadded:: 0.24.0.
504
+ nonexistent : {'raise', 'shift_forward', 'shift_backward, 'NaT', \
505
+ timedelta}, default 'raise'
506
+ A nonexistent time does not exist in a particular timezone where
507
+ clocks moved forward due to DST.
508
+
509
+ * 'shift_forward' will shift the nonexistent time forward to the
510
+ closest existing time.
511
+ * 'shift_backward' will shift the nonexistent time backward to the
512
+ closest existing time.
513
+ * 'NaT' will return NaT where there are nonexistent times.
514
+ * timedelta objects will shift nonexistent times by the timedelta.
515
+ * 'raise' will raise an NonExistentTimeError if there are
516
+ nonexistent times.
517
+
518
+ .. versionadded:: 0.24.0.
513
519
514
520
Raises
515
521
------
516
- ValueError if the freq cannot be converted
522
+ ValueError if the freq cannot be converted.
517
523
"""
518
524
return self ._round(freq, RoundTo.MINUS_INFTY, ambiguous, nonexistent)
519
525
@@ -523,33 +529,36 @@ default 'raise'
523
529
524
530
Parameters
525
531
----------
526
- freq : a freq string indicating the ceiling resolution
527
- ambiguous : bool, 'NaT', default 'raise'
528
- - bool contains flags to determine if time is dst or not (note
529
- that this flag is only applicable for ambiguous fall dst dates)
530
- - 'NaT' will return NaT for an ambiguous time
531
- - 'raise' will raise an AmbiguousTimeError for an ambiguous time
532
-
533
- .. versionadded:: 0.24.0
534
- nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \
535
- default 'raise'
536
- A nonexistent time does not exist in a particular timezone
537
- where clocks moved forward due to DST.
538
-
539
- - 'shift_forward' will shift the nonexistent time forward to the
540
- closest existing time
541
- - 'shift_backward' will shift the nonexistent time backward to the
542
- closest existing time
543
- - 'NaT' will return NaT where there are nonexistent times
544
- - timedelta objects will shift nonexistent times by the timedelta
545
- - 'raise' will raise an NonExistentTimeError if there are
546
- nonexistent times
547
-
548
- .. versionadded:: 0.24.0
532
+ freq : str
533
+ Frequency string indicating the ceiling resolution.
534
+ ambiguous : {'raise', 'NaT', bool}, default 'raise'
535
+ The behavior is as follows:
536
+
537
+ * bool contains flags to determine if time is dst or not (note
538
+ that this flag is only applicable for ambiguous fall dst dates).
539
+ * 'NaT' will return NaT for an ambiguous time.
540
+ * 'raise' will raise an AmbiguousTimeError for an ambiguous time.
541
+
542
+ .. versionadded:: 0.24.0.
543
+ nonexistent : {'raise', 'shift_forward', 'shift_backward, 'NaT', \
544
+ timedelta}, default 'raise'
545
+ A nonexistent time does not exist in a particular timezone where
546
+ clocks moved forward due to DST.
547
+
548
+ * 'shift_forward' will shift the nonexistent time forward to the
549
+ closest existing time.
550
+ * 'shift_backward' will shift the nonexistent time backward to the
551
+ closest existing time.
552
+ * 'NaT' will return NaT where there are nonexistent times.
553
+ * timedelta objects will shift nonexistent times by the timedelta.
554
+ * 'raise' will raise an NonExistentTimeError if there are
555
+ nonexistent times.
556
+
557
+ .. versionadded:: 0.24.0.
549
558
550
559
Raises
551
560
------
552
- ValueError if the freq cannot be converted
561
+ ValueError if the freq cannot be converted.
553
562
"""
554
563
return self ._round(freq, RoundTo.PLUS_INFTY, ambiguous, nonexistent)
555
564
@@ -606,7 +615,7 @@ default 'raise'
606
615
Parameters
607
616
----------
608
617
locale : string, default None (English locale)
609
- locale determining the language in which to return the day name
618
+ Locale determining the language in which to return the day name.
610
619
611
620
Returns
612
621
-------
@@ -623,7 +632,7 @@ default 'raise'
623
632
Parameters
624
633
----------
625
634
locale : string, default None (English locale)
626
- locale determining the language in which to return the month name
635
+ Locale determining the language in which to return the month name.
627
636
628
637
Returns
629
638
-------
@@ -779,35 +788,43 @@ default 'raise'
779
788
`ambiguous` parameter dictates how ambiguous times should be
780
789
handled.
781
790
782
- - bool contains flags to determine if time is dst or not (note
783
- that this flag is only applicable for ambiguous fall dst dates)
784
- - 'NaT' will return NaT for an ambiguous time
785
- - 'raise' will raise an AmbiguousTimeError for an ambiguous time
791
+ The behavior is as follows:
792
+
793
+ * bool contains flags to determine if time is dst or not (note
794
+ that this flag is only applicable for ambiguous fall dst dates).
795
+ * 'NaT' will return NaT for an ambiguous time.
796
+ * 'raise' will raise an AmbiguousTimeError for an ambiguous time.
786
797
787
798
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \
788
799
default 'raise'
789
800
A nonexistent time does not exist in a particular timezone
790
801
where clocks moved forward due to DST.
791
802
792
- - 'shift_forward' will shift the nonexistent time forward to the
793
- closest existing time
794
- - 'shift_backward' will shift the nonexistent time backward to the
795
- closest existing time
796
- - 'NaT' will return NaT where there are nonexistent times
797
- - timedelta objects will shift nonexistent times by the timedelta
798
- - 'raise' will raise an NonExistentTimeError if there are
799
- nonexistent times
803
+ The behavior is as follows:
800
804
801
- .. versionadded:: 0.24.0
805
+ * 'shift_forward' will shift the nonexistent time forward to the
806
+ closest existing time.
807
+ * 'shift_backward' will shift the nonexistent time backward to the
808
+ closest existing time.
809
+ * 'NaT' will return NaT where there are nonexistent times.
810
+ * timedelta objects will shift nonexistent times by the timedelta.
811
+ * 'raise' will raise an NonExistentTimeError if there are
812
+ nonexistent times.
813
+
814
+ .. versionadded:: 0.24.0.
802
815
803
816
errors : 'raise', 'coerce', default None
804
- - 'raise' will raise a NonExistentTimeError if a timestamp is not
805
- valid in the specified timezone (e.g. due to a transition from
806
- or to DST time). Use ``nonexistent='raise'`` instead.
807
- - 'coerce' will return NaT if the timestamp can not be converted
817
+ Determine how errors should be handled.
818
+
819
+ The behavior is as follows:
820
+
821
+ * 'raise' will raise a NonExistentTimeError if a timestamp is not
822
+ valid in the specified timezone (e.g. due to a transition from
823
+ or to DST time). Use ``nonexistent='raise'`` instead.
824
+ * 'coerce' will return NaT if the timestamp can not be converted
808
825
into the specified timezone. Use ``nonexistent='NaT'`` instead.
809
826
810
- .. deprecated:: 0.24.0
827
+ .. deprecated:: 0.24.0.
811
828
812
829
Returns
813
830
-------
0 commit comments