I have a numpy array like this:
[[[287 26]]
[[286 27]]
[[285 27]]
...
[[290 27]]
[[289 26]]
[[288 26]]]
and I would like to insert an integer and make it an array like
[
[287 26 integer]
[286 27 integer]
.......]
however, since the first array has different size than what I want at the end, simply using insert() function did not work for me.
Is there a work around?
Thanks in advance.
EDIT: So the closest I came so far is the following:
outline_poses = [] # final array
for cnt in cnts: # loop over each element
outline_poses.append(cnt[0])
outline_poses.append(SENSOR_MEASURED_HEIGHT) #Append this integer
Output:
[array([287, 26], dtype=int32), 60, array([286, 27], dtype=int32), 60,....]
How can I organize this array and make it look like [287, 26, 60],...?