0๐
โ
You can use list comprehension:
new_result = [{'x': el[0], 'y': el[1]} for el in result]
0๐
try sth like:
def convert_array(arr):
return [{'x':item[0],'y':item[1]} for item in arr]
use as:
converted_array = convert_array(numpy_array)
Source:stackexchange.com