#NEWLINE# def test_clip_with_datetimes( self ) : #NEWLINE# #INDENT# t = Timestamp ( '2015-12-01 09:30:30' ) #NEWLINE# s = Series ( [ Timestamp ( '2015-12-01 09:30:00' ) , Timestamp ( '2015-12-01 09:31:00' ) ] ) #NEWLINE# result = s . clip ( upper = t ) #NEWLINE# expected = Series ( [ Timestamp ( '2015-12-01 09:30:00' ) , Timestamp ( '2015-12-01 09:30:30' ) ] ) #NEWLINE# assert_series_equal ( result , expected ) #NEWLINE# t = Timestamp ( '2015-12-01 09:30:30' , tz = 'US/Eastern' ) #NEWLINE# s = Series ( [ Timestamp ( '2015-12-01 09:30:00' , tz = 'US/Eastern' ) , Timestamp ( '2015-12-01 09:31:00' , tz = 'US/Eastern' ) ] ) #NEWLINE# result = s . clip ( upper = t ) #NEWLINE# expected = Series ( [ Timestamp ( '2015-12-01 09:30:00' , tz = 'US/Eastern' ) , Timestamp ( '2015-12-01 09:30:30' , tz = 'US/Eastern' ) ] ) #NEWLINE# assert_series_equal ( result , expected )