Skip to content

DOC: Added docs to min/max/resolution for Timedelta #61117

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

Closed
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
3 changes: 0 additions & 3 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \
-i "pandas.Period.freq GL08" \
-i "pandas.Period.ordinal GL08" \
-i "pandas.Timedelta.max PR02" \
-i "pandas.Timedelta.min PR02" \
-i "pandas.Timedelta.resolution PR02" \
-i "pandas.Timestamp.max PR02" \
-i "pandas.Timestamp.min PR02" \
-i "pandas.Timestamp.resolution PR02" \
Expand Down
74 changes: 71 additions & 3 deletions pandas/_libs/tslibs/timedeltas.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1033,9 +1033,77 @@ cdef class _Timedelta(timedelta):

# higher than np.ndarray and np.matrix
__array_priority__ = 100
min = MinMaxReso("min")
max = MinMaxReso("max")
resolution = MinMaxReso("resolution")

@property
def min(self):
"""
Returns the minimum bound possible for Timedelta.

Returns the smallest possible value represented by 64 bits.

Returns
-------
int

See Also
--------
Timedelta.max: Returns the maximum bound possible for Timedelta.
Timedelta.resolution: Returns the smallest possible difference between
non-equal Timedelta objects.

Examples
--------
>>> pd.Timedelta.min
-9223372036854775807
"""
return MinMaxReso("min")

@property
def max(self):
"""
Returns the maximum bound possible for Timedelta.

Returns the largest possible value represented by 64 bits.

Returns
-------
int

See Also
--------
Timedelta.min: Returns the minimum bound possible for Timedelta.
Timedelta.resolution: Returns the smallest possible difference between
non-equal Timedelta objects.

Examples
--------
>>> pd.Timedelta.max
9223372036854775807
"""
return MinMaxReso("max")

@property
def resolution(self):
"""
Returns the smalleset possible difference between non-equal Timedelta objects.

Returns the integer 1.

Returns
-------
int

See Also
--------
Timedelta.max: Returns the maximum bound possible for Timedelta.
Timedelta.min: Returns the minimum bound possible for Timedelta.

Examples
--------
>>> pd.Timedelta.resolution
1
"""
return MinMaxReso("resolution")

@property
def value(self):
Expand Down
Loading