Skip to content

Commit 84bce21

Browse files
WillAydjreback
authored andcommitted
CLN: Removed overridden Timedelta properties (#18242) (#18374)
1 parent f85cdfd commit 84bce21

File tree

2 files changed

+1
-31
lines changed

2 files changed

+1
-31
lines changed

doc/source/whatsnew/v0.22.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Performance Improvements
7979
- Added a keyword argument, ``cache``, to :func:`to_datetime` that improved the performance of converting duplicate datetime arguments (:issue:`11665`)
8080
- :class`DateOffset` arithmetic performance is improved (:issue:`18218`)
8181
- Converting a ``Series`` of ``Timedelta`` objects to days, seconds, etc... sped up through vectorization of underlying methods (:issue:`18092`)
82-
-
82+
- The overriden ``Timedelta`` properties of days, seconds and microseconds have been removed, leveraging their built-in Python versions instead (:issue:`18242`)
8383

8484
.. _whatsnew_0220.docs:
8585

pandas/_libs/tslibs/timedeltas.pyx

-30
Original file line numberDiff line numberDiff line change
@@ -665,36 +665,6 @@ cdef class _Timedelta(timedelta):
665665
else:
666666
return "D"
667667

668-
@property
669-
def days(self):
670-
"""
671-
Number of Days
672-
673-
.components will return the shown components
674-
"""
675-
self._ensure_components()
676-
return self._d
677-
678-
@property
679-
def seconds(self):
680-
"""
681-
Number of seconds (>= 0 and less than 1 day).
682-
683-
.components will return the shown components
684-
"""
685-
self._ensure_components()
686-
return self._seconds
687-
688-
@property
689-
def microseconds(self):
690-
"""
691-
Number of microseconds (>= 0 and less than 1 second).
692-
693-
.components will return the shown components
694-
"""
695-
self._ensure_components()
696-
return self._microseconds
697-
698668
@property
699669
def nanoseconds(self):
700670
"""

0 commit comments

Comments
 (0)