File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ def _isnull_ndarraylike(obj):
90
90
elif values .dtype == np .dtype ('M8[ns]' ):
91
91
# this is the NaT pattern
92
92
result = values .view ('i8' ) == lib .iNaT
93
+ elif issubclass (values .dtype .type , np .timedelta64 ):
94
+ result = - np .isfinite (values .view ('i8' ))
93
95
else :
94
96
result = - np .isfinite (obj )
95
97
return result
@@ -800,7 +802,8 @@ def is_integer_dtype(arr_or_dtype):
800
802
else :
801
803
tipo = arr_or_dtype .dtype .type
802
804
return (issubclass (tipo , np .integer ) and not
803
- issubclass (tipo , np .datetime64 ))
805
+ (issubclass (tipo , np .datetime64 ) or
806
+ issubclass (tipo , np .timedelta64 )))
804
807
805
808
806
809
def is_datetime64_dtype (arr_or_dtype ):
Original file line number Diff line number Diff line change @@ -879,6 +879,11 @@ def test_float_trim_zeros(self):
879
879
for line in repr (Series (vals )).split ('\n ' ):
880
880
self .assert_ ('+10' in line )
881
881
882
+ def test_timedelta64 (self ):
883
+ Series (np .array ([1100 , 20 ], dtype = 'timedelta64[s]' )).to_string ()
884
+ #check this works
885
+ #GH2146
886
+
882
887
883
888
class TestEngFormatter (unittest .TestCase ):
884
889
You can’t perform that action at this time.
0 commit comments