diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 4ed27ce8c9298..b009212084dde 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -131,7 +131,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Timestamp.nanosecond GL08" \ -i "pandas.Timestamp.resolution PR02" \ -i "pandas.Timestamp.tzinfo GL08" \ - -i "pandas.Timestamp.value GL08" \ -i "pandas.Timestamp.year GL08" \ -i "pandas.api.extensions.ExtensionArray.interpolate PR01,SA01" \ -i "pandas.api.types.is_bool PR01,SA01" \ diff --git a/pandas/_libs/tslibs/timestamps.pyx b/pandas/_libs/tslibs/timestamps.pyx index b3811eb644dc5..34c84d396ad64 100644 --- a/pandas/_libs/tslibs/timestamps.pyx +++ b/pandas/_libs/tslibs/timestamps.pyx @@ -240,6 +240,27 @@ cdef class _Timestamp(ABCTimestamp): @property def value(self) -> int: + """ + Return the value of the Timestamp. + + Returns + ------- + int + The integer representation of the Timestamp object in nanoseconds + since the Unix epoch (1970-01-01 00:00:00 UTC). + + See Also + -------- + Timestamp.second : Return the second of the Timestamp. + Timestamp.minute : Return the minute of the Timestamp. + + Examples + -------- + >>> ts = pd.Timestamp("2024-08-31 16:16:30") + >>> ts.value + 1725120990000000000 + """ + try: return convert_reso(self._value, self._creso, NPY_FR_ns, False) except OverflowError: @@ -1020,8 +1041,8 @@ cdef class _Timestamp(ABCTimestamp): See Also -------- - Timestamp.day : Return the day of the year. - Timestamp.year : Return the year of the week. + Timestamp.day : Return the day of the Timestamp. + Timestamp.year : Return the year of the Timestamp. Examples --------