#NEWLINE# def test_minmax( self ) : #NEWLINE# #INDENT# idx1 = TimedeltaIndex ( [ '1 days' , '2 days' , '3 days' ] ) #NEWLINE# self . assertTrue ( idx1 . is_monotonic ) #NEWLINE# idx2 = TimedeltaIndex ( [ '1 days' , np . nan , '3 days' , 'NaT' ] ) #NEWLINE# self . assertFalse ( idx2 . is_monotonic ) #NEWLINE# for idx in [ idx1 , idx2 ] : #NEWLINE# #INDENT# ( self . assertEqual ( idx . min ( ) , Timedelta ( '1 days' ) ) , ) #NEWLINE# ( self . assertEqual ( idx . max ( ) , Timedelta ( '3 days' ) ) , ) #NEWLINE# self . assertEqual ( idx . argmin ( ) , 0 ) #NEWLINE# self . assertEqual ( idx . argmax ( ) , 2 ) #NEWLINE# #UNINDENT# for op in [ 'min' , 'max' ] : #NEWLINE# #INDENT# obj = TimedeltaIndex ( [ ] ) #NEWLINE# self . assertTrue ( pd . isnull ( getattr ( obj , op ) ( ) ) ) #NEWLINE# obj = TimedeltaIndex ( [ pd . NaT ] ) #NEWLINE# self . assertTrue ( pd . isnull ( getattr ( obj , op ) ( ) ) ) #NEWLINE# obj = TimedeltaIndex ( [ pd . NaT , pd . NaT , pd . NaT ] ) #NEWLINE# self . assertTrue ( pd . isnull ( getattr ( obj , op ) ( ) ) )