#NEWLINE# def test_clip_types_and_nulls( self ) : #NEWLINE# #INDENT# sers = [ Series ( [ np . nan , 1.0 , 2.0 , 3.0 ] ) , Series ( [ None , 'a' , 'b' , 'c' ] ) , Series ( pd . to_datetime ( [ np . nan , 1 , 2 , 3 ] , unit = 'D' ) ) ] #NEWLINE# for s in sers : #NEWLINE# #INDENT# thresh = s [ 2 ] #NEWLINE# l = s . clip_lower ( thresh ) #NEWLINE# u = s . clip_upper ( thresh ) #NEWLINE# self . assertEqual ( l [ notnull ( l ) ] . min ( ) , thresh ) #NEWLINE# self . assertEqual ( u [ notnull ( u ) ] . max ( ) , thresh ) #NEWLINE# self . assertEqual ( list ( isnull ( s ) ) , list ( isnull ( l ) ) ) #NEWLINE# self . assertEqual ( list ( isnull ( s ) ) , list ( isnull ( u ) ) )