I have a Python numpy array called myarray that looks like this..
[[148 362]
[153 403]
[163 443]
[172 483]
[186 521]
[210 553]
[239 581]
[273 604]
[314 611]
[353 602]]
I want to create JSON that looks like this..
myjson = [
{'section': '3',
'x': '163',
'y': '362',
},
{'section': '7',
'x': '239',
'y': '581',
},
{'section': '10',
'x': '353',
'y': '602',
},
]
This represents the 3rd, 7th and 10th line in the original numpy array. Does anybody have an example of something similar being achieved?