@@ -909,16 +909,20 @@ cdef class _Timestamp(ABCTimestamp):
909
909
Examples
910
910
--------
911
911
>>> ts = pd.Timestamp('2020-03-14T15:32:52.192548651')
912
- >>> ts.to_period(freq='Y) # Year end frequency
913
- numpy.datetime64('2020-03-14T15:32:52.192548651')
912
+ >>> # Year end frequency
913
+ >>> ts.to_period(freq='Y')
914
+ Period('2020', 'A-DEC')
914
915
915
- >>> ts.to_period(freq='M') # Month end frequency
916
+ >>> # Month end frequency
917
+ >>> ts.to_period(freq='M')
916
918
Period('2020-03', 'M')
917
919
918
- >>> ts.to_period(freq='W') # Weekly frequency
920
+ >>> # Weekly frequency
921
+ >>> ts.to_period(freq='W')
919
922
Period('2020-03-09/2020-03-15', 'W-SUN')
920
923
921
- >>> ts.to_period(freq='Q') # Quarter end frequency
924
+ >>> # Quarter end frequency
925
+ >>> ts.to_period(freq='Q')
922
926
Period('2020Q1', 'Q-DEC')
923
927
"""
924
928
from pandas import Period
@@ -1059,7 +1063,7 @@ class Timestamp(_Timestamp):
1059
1063
1060
1064
Examples
1061
1065
--------
1062
- >>> pd.Timestamp.now()
1066
+ >>> pd.Timestamp.now() # doctest: +SKIP
1063
1067
Timestamp('2020-11-16 22:06:16.378782')
1064
1068
1065
1069
Analogous for ``pd.NaT``:
@@ -1087,7 +1091,7 @@ class Timestamp(_Timestamp):
1087
1091
1088
1092
Examples
1089
1093
--------
1090
- >>> pd.Timestamp.today()
1094
+ >>> pd.Timestamp.today() # doctest: +SKIP
1091
1095
Timestamp('2020-11-16 22:37:39.969883')
1092
1096
1093
1097
Analogous for ``pd.NaT``:
@@ -1106,7 +1110,7 @@ class Timestamp(_Timestamp):
1106
1110
1107
1111
Examples
1108
1112
--------
1109
- >>> pd.Timestamp.utcnow()
1113
+ >>> pd.Timestamp.utcnow() # doctest: +SKIP
1110
1114
Timestamp('2020-11-16 22:50:18.092888+0000', tz='UTC')
1111
1115
"""
1112
1116
return cls .now(UTC)
0 commit comments