#NEWLINE# def test_set_index_bug( self ) : #NEWLINE# #INDENT# df = DataFrame ( { #NEWLINE# #INDENT# 'val' : [ 0 , 1 , 2 ] , #NEWLINE# 'key' : [ 'a' , 'b' , 'c' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# df2 = df . select ( ( lambda indx : ( indx >= 1 ) ) ) #NEWLINE# rs = df2 . set_index ( 'key' ) #NEWLINE# xp = DataFrame ( { #NEWLINE# #INDENT# 'val' : [ 1 , 2 ] , #NEWLINE# #UNINDENT# } , Index ( [ 'b' , 'c' ] , name = 'key' ) ) #NEWLINE# assert_frame_equal ( xp , xp )