diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 4bea3a462db07..a194c340c63a5 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -148,7 +148,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.cat.set_categories PR01,PR02" \ -i "pandas.Series.dt.as_unit PR01,PR02" \ -i "pandas.Series.dt.ceil PR01,PR02" \ - -i "pandas.Series.dt.components SA01" \ -i "pandas.Series.dt.day_name PR01,PR02" \ -i "pandas.Series.dt.floor PR01,PR02" \ -i "pandas.Series.dt.freq GL08" \ diff --git a/pandas/core/indexes/accessors.py b/pandas/core/indexes/accessors.py index 3dcd1fedc8d64..3cb51f7447677 100644 --- a/pandas/core/indexes/accessors.py +++ b/pandas/core/indexes/accessors.py @@ -489,10 +489,20 @@ def components(self) -> DataFrame: """ Return a Dataframe of the components of the Timedeltas. + Each row of the DataFrame corresponds to a Timedelta in the original + Series and contains the individual components (days, hours, minutes, + seconds, milliseconds, microseconds, nanoseconds) of the Timedelta. + Returns ------- DataFrame + See Also + -------- + TimedeltaIndex.components : Return a DataFrame of the individual resolution + components of the Timedeltas. + Series.dt.total_seconds : Return the total number of seconds in the duration. + Examples -------- >>> s = pd.Series(pd.to_timedelta(np.arange(5), unit="s"))