#NEWLINE# def test_pop_non_unique_cols( self ) : #NEWLINE# #INDENT# df = DataFrame ( { #NEWLINE# #INDENT# 0 : [ 0 , 1 ] , #NEWLINE# 1 : [ 0 , 1 ] , #NEWLINE# 2 : [ 4 , 5 ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# df . columns = [ 'a' , 'b' , 'a' ] #NEWLINE# res = df . pop ( 'a' ) #NEWLINE# self . assertEqual ( type ( res ) , DataFrame ) #NEWLINE# self . assertEqual ( len ( res ) , 2 ) #NEWLINE# self . assertEqual ( len ( df . columns ) , 1 ) #NEWLINE# self . assertTrue ( ( 'b' in df . columns ) ) #NEWLINE# self . assertFalse ( ( 'a' in df . columns ) ) #NEWLINE# self . assertEqual ( len ( df . index ) , 2 )