Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new variables for docstring #48831

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/timestamps.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cdef _Timestamp create_timestamp_from_ts(int64_t value,

cdef class _Timestamp(ABCTimestamp):
cdef readonly:
int64_t value, nanosecond, year
int64_t value, nanosecond, year, _hour
BaseOffset _freq
NPY_DATETIMEUNIT _reso

Expand Down
8 changes: 8 additions & 0 deletions pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ cdef inline _Timestamp create_timestamp_from_ts(
ts_base.value = value
ts_base._freq = freq
ts_base.year = dts.year
ts_base._hour = dts.hour
ts_base.nanosecond = dts.ps // 1000
ts_base._reso = reso

Expand Down Expand Up @@ -2369,6 +2370,13 @@ default 'raise'
self.nanosecond / 3600.0 / 1e+9
) / 24.0)

@property
def hour(self):
"""
My hour
"""
return self._hour

def isoweekday(self):
"""
Return the day of the week represented by the date.
Expand Down