File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -1241,6 +1241,31 @@ cdef class _Period(object):
1241
1241
1242
1242
@property
1243
1243
def hour (self ):
1244
+ """
1245
+ Get the hour of the day component of the Period.
1246
+
1247
+ Returns
1248
+ -------
1249
+ int
1250
+ The hour as an integer, between 0 and 23.
1251
+
1252
+ See Also
1253
+ --------
1254
+ Period.second : Get the second component of the Period.
1255
+ Period.minute : Get the minute component of the Period.
1256
+
1257
+ Examples
1258
+ --------
1259
+ >>> p = pd.Period("2018-03-11 13:03:12.050000")
1260
+ >>> p.hour
1261
+ 13
1262
+
1263
+ Period longer than a day
1264
+
1265
+ >>> p = pd.Period("2018-03-11", freq="M")
1266
+ >>> p.hour
1267
+ 0
1268
+ """
1244
1269
base, mult = get_freq_code(self .freq)
1245
1270
return phour(self .ordinal, base)
1246
1271
You can’t perform that action at this time.
0 commit comments