File tree 1 file changed +31
-1
lines changed
1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -829,7 +829,37 @@ cdef class _Timedelta(timedelta):
829
829
830
830
@property
831
831
def asm8 (self ):
832
- """ return a numpy timedelta64 array view of myself """
832
+ """
833
+ Return a numpy timedelta64 array scalar view.
834
+
835
+ Provides access to the array scalar view (i.e. a combination of the
836
+ value and the units) associated with the numpy.timedelta64().view(),
837
+ including a 64-bit integer representation of the timedelta in
838
+ nanoseconds (Python int compatible).
839
+
840
+ Returns
841
+ -------
842
+ numpy timedelta64 array scalar view
843
+ Array scalar view of the timedelta in nanoseconds.
844
+
845
+ Examples
846
+ --------
847
+ >>> td = pd.Timedelta('1 days 2 min 3 us 42 ns')
848
+ >>> td.asm8
849
+ numpy.timedelta64(86520000003042,'ns')
850
+
851
+ >>> td = pd.Timedelta('2 min 3 s')
852
+ >>> td.asm8
853
+ numpy.timedelta64(123000000000,'ns')
854
+
855
+ >>> td = pd.Timedelta('3 ms 5 us')
856
+ >>> td.asm8
857
+ numpy.timedelta64(3005000,'ns')
858
+
859
+ >>> td = pd.Timedelta(42, unit='ns')
860
+ >>> td.asm8
861
+ numpy.timedelta64(42,'ns')
862
+ """
833
863
return np.int64(self .value).view(' m8[ns]' )
834
864
835
865
@property
You can’t perform that action at this time.
0 commit comments