#NEWLINE# def test_list_to_numpy_on_dicts( ) : #NEWLINE# #INDENT# data = [ { #NEWLINE# #INDENT# 'name' : 'Alice' , #NEWLINE# 'amount' : 100 , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'name' : 'Bob' , #NEWLINE# 'amount' : 200 , #NEWLINE# #UNINDENT# } ] #NEWLINE# ds = datashape . dshape ( 'var * {name: string[5], amount: int}' ) #NEWLINE# x = list_to_numpy ( data , dshape = x ) #NEWLINE# assert ( convert ( list , x ) == [ ( 'Alice' , 100 ) , ( 'Bob' , 200 ) ] )