@@ -817,20 +817,74 @@ def to_pytimedelta(self) -> npt.NDArray[np.object_]:
817
817
dtype: int64"""
818
818
)
819
819
days = _field_accessor ("days" , "days" , days_docstring )
820
+
821
+ seconds_docstring = textwrap .dedent (
822
+ """Number of seconds (>= 0 and less than 1 day) for each element.
823
+
824
+ Examples
825
+ --------
826
+ >>> ser = pd.Series(pd.to_timedelta([1, 2, 3], unit='S'))
827
+ >>> ser
828
+ 0 0 days 00:00:01
829
+ 1 0 days 00:00:02
830
+ 2 0 days 00:00:03
831
+ dtype: timedelta64[ns]
832
+ >>> ser.dt.seconds
833
+ 0 1
834
+ 1 2
835
+ 2 3
836
+ dtype: int32"""
837
+ )
820
838
seconds = _field_accessor (
821
839
"seconds" ,
822
840
"seconds" ,
823
- "Number of seconds (>= 0 and less than 1 day) for each element." ,
841
+ seconds_docstring ,
842
+ )
843
+
844
+ microseconds_docstring = textwrap .dedent (
845
+ """Number of microseconds (>= 0 and less than 1 second) for each element.
846
+
847
+ Examples
848
+ --------
849
+ >>> ser = pd.Series(pd.to_timedelta([1, 2, 3], unit='U'))
850
+ >>> ser
851
+ 0 0 days 00:00:00.000001
852
+ 1 0 days 00:00:00.000002
853
+ 2 0 days 00:00:00.000003
854
+ dtype: timedelta64[ns]
855
+ >>> ser.dt.microseconds
856
+ 0 1
857
+ 1 2
858
+ 2 3
859
+ dtype: int32"""
824
860
)
825
861
microseconds = _field_accessor (
826
862
"microseconds" ,
827
863
"microseconds" ,
828
- "Number of microseconds (>= 0 and less than 1 second) for each element." ,
864
+ microseconds_docstring ,
865
+ )
866
+
867
+ nanoseconds_docstring = textwrap .dedent (
868
+ """Number of nanoseconds (>= 0 and less than 1 microsecond) for each element.
869
+
870
+ Examples
871
+ --------
872
+ >>> ser = pd.Series(pd.to_timedelta([1, 2, 3], unit='N'))
873
+ >>> ser
874
+ 0 0 days 00:00:00.000000001
875
+ 1 0 days 00:00:00.000000002
876
+ 2 0 days 00:00:00.000000003
877
+ dtype: timedelta64[ns]
878
+ >>> ser.dt.nanoseconds
879
+ 0 1
880
+ 1 2
881
+ 2 3
882
+ dtype: int32"""
829
883
)
830
884
nanoseconds = _field_accessor (
831
885
"nanoseconds" ,
832
886
"nanoseconds" ,
833
- "Number of nanoseconds (>= 0 and less than 1 microsecond) for each element." ,
887
+ nanoseconds_docstring ,
834
888
)
835
889
836
890
@property
0 commit comments