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