From 4d7f6f2af83300cc086f4b2b19fdaa738cec5b1d Mon Sep 17 00:00:00 2001 From: Brock Mendel Date: Mon, 4 Sep 2017 12:33:56 -0700 Subject: [PATCH 1/2] Dont re-pin total seconds as it is already implemented --- pandas/_libs/tslib.pyx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/_libs/tslib.pyx b/pandas/_libs/tslib.pyx index 50e0b77c6d3a0..10922e8b9fc4e 100644 --- a/pandas/_libs/tslib.pyx +++ b/pandas/_libs/tslib.pyx @@ -3892,8 +3892,9 @@ for field in fields: _nat_methods = ['date', 'now', 'replace', 'to_pydatetime', 'today', 'round', 'floor', 'ceil', 'tz_convert', 'tz_localize'] -_nan_methods = ['weekday', 'isoweekday', 'total_seconds'] -_implemented_methods = ['to_datetime', 'to_datetime64', 'isoformat'] +_nan_methods = ['weekday', 'isoweekday'] +_implemented_methods = [ + 'to_datetime', 'to_datetime64', 'isoformat', 'total_seconds'] _implemented_methods.extend(_nat_methods) _implemented_methods.extend(_nan_methods) From 1a029c307a74ece1878502a01cf0444a1dcf8228 Mon Sep 17 00:00:00 2001 From: Brock Mendel Date: Wed, 6 Sep 2017 08:43:56 -0700 Subject: [PATCH 2/2] Add docstring to total_seconds --- pandas/_libs/tslib.pyx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandas/_libs/tslib.pyx b/pandas/_libs/tslib.pyx index 10922e8b9fc4e..bd0d0fe5559d3 100644 --- a/pandas/_libs/tslib.pyx +++ b/pandas/_libs/tslib.pyx @@ -858,6 +858,9 @@ class NaTType(_NaT): return (__nat_unpickle, (None, )) def total_seconds(self): + """ + Total duration of timedelta in seconds (to ns precision) + """ # GH 10939 return np.nan