#NEWLINE# def test_clip( self ) : #NEWLINE# #INDENT# val = self . ts . median ( ) #NEWLINE# self . assertEqual ( self . ts . clip_lower ( val ) . min ( ) , val ) #NEWLINE# self . assertEqual ( self . ts . clip_upper ( val ) . max ( ) , val ) #NEWLINE# self . assertEqual ( self . ts . clip ( lower = val ) . min ( ) , self ) #NEWLINE# self . assertEqual ( self . ts . clip ( upper = val ) . max ( ) , val ) #NEWLINE# result = self . ts . clip ( ( - 0.5 ) , 0.5 ) #NEWLINE# expected = np . clip ( self . ts , ( - 0.5 ) , 0.5 ) #NEWLINE# assert_series_equal ( result , expected ) #NEWLINE# tm . assertIsInstance ( expected , Series )