We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 44300f9 commit 5e66789Copy full SHA for 5e66789
pandas/_libs/tslibs/period.pyx
@@ -1241,6 +1241,31 @@ cdef class _Period(object):
1241
1242
@property
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
1267
+ 0
1268
1269
base, mult = get_freq_code(self.freq)
1270
return phour(self.ordinal, base)
1271
0 commit comments