Skip to content

Commit 7815ef0

Browse files
author
dcreekp
committed
DOC: Reposition quotes in pandas.Timestamp and pandas.Timedelta #24070
1 parent 099cd57 commit 7815ef0

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -815,28 +815,34 @@ cdef class _Timedelta(timedelta):
815815

816816
cpdef timedelta to_pytimedelta(_Timedelta self):
817817
"""
818-
return an actual datetime.timedelta object
819-
note: we lose nanosecond resolution if any
818+
Return an actual datetime.timedelta object.
819+
Note: we lose nanosecond resolution if any.
820820
"""
821821
return timedelta(microseconds=int(self.value) / 1000)
822822

823823
def to_timedelta64(self):
824-
""" Returns a numpy.timedelta64 object with 'ns' precision """
824+
"""
825+
Returns a numpy.timedelta64 object with 'ns' precision.
826+
"""
825827
return np.timedelta64(self.value, 'ns')
826828

827829
def total_seconds(self):
828830
"""
829-
Total duration of timedelta in seconds (to ns precision)
831+
Total duration of timedelta in seconds (to ns precision).
830832
"""
831833
return self.value / 1e9
832834

833835
def view(self, dtype):
834-
""" array view compat """
836+
"""
837+
Array view compatibility.
838+
"""
835839
return np.timedelta64(self.value).view(dtype)
836840

837841
@property
838842
def components(self):
839-
""" Return a Components NamedTuple-like """
843+
"""
844+
Return a Components NamedTuple-like.
845+
"""
840846
self._ensure_components()
841847
# return the named tuple
842848
return Components(self._d, self._h, self._m, self._s,
@@ -1135,8 +1141,8 @@ class Timedelta(_Timedelta):
11351141
Notes
11361142
-----
11371143
The ``.value`` attribute is always in ns.
1138-
11391144
"""
1145+
11401146
def __new__(cls, object value=_no_input, unit=None, **kwargs):
11411147
cdef _Timedelta td_base
11421148

pandas/_libs/tslibs/timestamps.pyx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,8 @@ cdef class _Timestamp(datetime):
526526

527527

528528
class Timestamp(_Timestamp):
529-
"""Pandas replacement for datetime.datetime
529+
"""
530+
Pandas replacement for datetime.datetime
530531
531532
Timestamp is the pandas equivalent of python's Datetime
532533
and is interchangeable with it in most cases. It's the type used

0 commit comments

Comments
 (0)