def arrays_to_list_of_tuples(arrays, colnames):
 first_array = arrays[colnames[0]]
 return [tuple((arrays[colname][i] for colname in colnames)) for i in range(len(first_array))]

def arrays_to_list_of_tuples ( arrays , colnames ) : first_array = arrays [ colnames [ 0 ] ] return [ tuple ( ( arrays [ colname ] [ i ] for colname in colnames ) ) for i in range ( len ( first_array ) ) ]
convert a dict of arrays to a list of tuples .