By reproducing the same nested list you have, it's become easy to understand:
import numpy as np
arr1 = np.array([[20913, 28913, 36913, 44913, 52914, 60914]], dtype=np.int32)
arr2 = np.array([[1, 1, -1, 1, 1, 1]], dtype=np.int16)
lst = [[arr1, arr2]]
print(lst)
The above is your lst
structure, also arr1
and arr2
are (1,1) :
nested1 = lst[0][0].tolist()[0]
nested2 = lst[0][1].tolist()[0]
print(nested1)
print(nested2)
first [0]
to get the [arr1, arr2]
. Next bracket is for arr1
and arr2
respectfully.
with tolist()
you can convert them to python's built-in list type and because they are (1,1) you need the first item which means [0]
.