#NEWLINE# def test_reindex( self ) : #NEWLINE# #INDENT# with tm . assert_produces_warning ( FutureWarning , check_stacklevel = False ) : #NEWLINE# #INDENT# def _compare_with_dense( swp , items , major , minor ) : #NEWLINE# #INDENT# swp_re = swp . reindex ( items = items , major = major , minor = minor ) #NEWLINE# dwp_re = swp . to_dense ( ) . reindex ( items = items , major = major , minor = minor ) #NEWLINE# tm . assert_panel_equal ( swp_re . to_dense ( ) , dwp_re ) #NEWLINE# #UNINDENT# _compare_with_dense ( self . panel , self . panel . items [ : 2 ] , self . panel . major_axis [ : : 2 ] , self . panel . minor_axis [ : : 2 ] ) #NEWLINE# _compare_with_dense ( self . panel , None , self . panel . major_axis [ : : 2 ] , self . panel . minor_axis [ : : 2 ] ) #NEWLINE# self . assertRaises ( ValueError , self . panel . reindex ) #NEWLINE# self . assertRaises ( Exception , self . panel . reindex , items = [ 'item0' , 'ItemA' , 'ItemB' ] ) #NEWLINE# cp = self . panel . reindex ( self . panel . major_axis , copy = True ) #NEWLINE# cp [ 'ItemA' ] [ 'E' ] = cp [ 'ItemA' ] [ 'A' ] #NEWLINE# self . assertNotIn ( 'E' , self . panel [ 'ItemA' ] )