From 2dda0c18a8abbbc1cac8d711fbd42237688b2667 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Tue, 20 Jan 2015 21:14:28 +0100 Subject: [PATCH] DOC: delete removed Timedelta properties (see GH9257) from API overview + add docstring for components --- doc/source/api.rst | 6 ------ pandas/tseries/common.py | 9 +++++++++ pandas/tseries/tdi.py | 3 ++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/doc/source/api.rst b/doc/source/api.rst index b6fd14f425bd0..9d40fe9114f97 100644 --- a/doc/source/api.rst +++ b/doc/source/api.rst @@ -498,10 +498,7 @@ Due to implementation details the methods show up here as methods of the :toctree: generated/ TimedeltaProperties.days - TimedeltaProperties.hours - TimedeltaProperties.minutes TimedeltaProperties.seconds - TimedeltaProperties.milliseconds TimedeltaProperties.microseconds TimedeltaProperties.nanoseconds TimedeltaProperties.components @@ -1358,10 +1355,7 @@ Components :toctree: generated/ TimedeltaIndex.days - TimedeltaIndex.hours - TimedeltaIndex.minutes TimedeltaIndex.seconds - TimedeltaIndex.milliseconds TimedeltaIndex.microseconds TimedeltaIndex.nanoseconds TimedeltaIndex.components diff --git a/pandas/tseries/common.py b/pandas/tseries/common.py index c953c0961a596..7f6a0bc60dd57 100644 --- a/pandas/tseries/common.py +++ b/pandas/tseries/common.py @@ -139,6 +139,15 @@ def to_pytimedelta(self): @property def components(self): + """ + Return a dataframe of the components (days, hours, minutes, + seconds, milliseconds, microseconds, nanoseconds) of the Timedeltas. + + Returns + ------- + a DataFrame + + """ return self.values.components.set_index(self.index) TimedeltaProperties._add_delegate_accessors(delegate=TimedeltaIndex, diff --git a/pandas/tseries/tdi.py b/pandas/tseries/tdi.py index 2afdff2982d8a..db23c42294fd5 100644 --- a/pandas/tseries/tdi.py +++ b/pandas/tseries/tdi.py @@ -370,7 +370,8 @@ def nanoseconds(self): @property def components(self): """ - Return a dataframe of the components of the Timedeltas + Return a dataframe of the components (days, hours, minutes, + seconds, milliseconds, microseconds, nanoseconds) of the Timedeltas. Returns -------