#NEWLINE# def test_shift_categorical( self ) : #NEWLINE# #INDENT# s1 = pd . Series ( [ 'a' , 'b' , 'c' ] , dtype = 'category' ) #NEWLINE# s2 = pd . Series ( [ 'A' , 'B' , 'C' ] , dtype = 'category' ) #NEWLINE# df = DataFrame ( { #NEWLINE# #INDENT# 'one' : s1 , #NEWLINE# 'two' : s1 , #NEWLINE# #UNINDENT# } ) #NEWLINE# rs = df . shift ( 1 ) #NEWLINE# xp = DataFrame ( { #NEWLINE# #INDENT# 'one' : s1 . shift ( 1 ) , #NEWLINE# 'two' : s2 . shift ( 1 ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert_frame_equal ( rs , xp )