Skip to content

Commit 8a60f00

Browse files
committed
moved attributes back to Timedelta, set as read only
1 parent 5e0f541 commit 8a60f00

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,13 +1031,6 @@ cdef class _Timedelta(timedelta):
10311031
# int64_t _d, _h, _m, _s, _ms, _us, _ns
10321032
# NPY_DATETIMEUNIT _reso
10331033

1034-
"""
1035-
Attributes:
1036-
min (Timedelta): Minimum allowable value for Timedelta.
1037-
max (Timedelta): Maximum allowable value for Timedelta.
1038-
resolution (Timedelta): Resolution of the Timedelta.
1039-
"""
1040-
10411034
# higher than np.ndarray and np.matrix
10421035
__array_priority__ = 100
10431036
min = MinMaxReso("min")
@@ -1901,6 +1894,17 @@ class Timedelta(_Timedelta):
19011894
Values for construction in compat with datetime.timedelta.
19021895
Numpy ints and floats will be coerced to python ints and floats.
19031896
1897+
Attributes
1898+
----------
1899+
min : Timedelta, readonly
1900+
The minimum representable `Timedelta`, corresponding to the smallest
1901+
duration supported.
1902+
max : Timedelta, readonly
1903+
The maximum representable `Timedelta`, corresponding to the largest
1904+
duration supported.
1905+
resolution : Timedelta, readonly
1906+
The smallest possible difference between non-equal `Timedelta` objects.
1907+
19041908
See Also
19051909
--------
19061910
Timestamp : Represents a single timestamp in time.
@@ -1940,6 +1944,10 @@ class Timedelta(_Timedelta):
19401944
_req_any_kwargs_new = {"weeks", "days", "hours", "minutes", "seconds",
19411945
"milliseconds", "microseconds", "nanoseconds"}
19421946

1947+
min = MinMaxReso("min")
1948+
max = MinMaxReso("max")
1949+
resolution = MinMaxReso("resolution")
1950+
19431951
def __new__(cls, object value=_no_input, unit=None, **kwargs):
19441952
if value is _no_input:
19451953
if not len(kwargs):

0 commit comments

Comments
 (0)