#NEWLINE# def test_from_records_empty_with_nonempty_fields_gh3682( self ) : #NEWLINE# #INDENT# a = np . array ( [ ( 1 , 2 ) ] , dtype = [ ( 'id' , np . int64 ) , ( 'value' , np . int64 ) ] ) #NEWLINE# df = DataFrame . from_records ( a , index = 'id' ) #NEWLINE# assert_numpy_array_equal ( df . index , Index ( [ 1 ] , name = 'id' ) ) #NEWLINE# self . assertEqual ( df . index . name , 'id' ) #NEWLINE# assert_numpy_array_equal ( df . columns , Index ( [ 'value' ] ) ) #NEWLINE# b = np . array ( [ ] , dtype = [ ( 'id' , np . int64 ) , ( 'value' , np . int64 ) ] ) #NEWLINE# df = DataFrame . from_records ( b , index = 'id' ) #NEWLINE# assert_numpy_array_equal ( df . index , Index ( [ ] , name = 'id' ) ) #NEWLINE# self . assertEqual ( df . index . name , 'id' )