Вы можете поместить объект в ту позицию, которая представляет массив.
import numpy as np
class Arr:
def __init__(self, some_array):
self.arr = some_array
array1 = [np.array([1,2,3,4]), np.array([5, 6, 7, 8])]
array2 = [np.array([1, 44, 5, 66]), np.array([90, 91, 93, 94])]
arrays_objs1 = Arr(np.array([Arr(x) for x in array1]))
arrays_objs2 = Arr(np.array([Arr(x) for x in array2]))
new_matrix = np.matrix([arrays_objs1, arrays_objs2])
for j in range(0, 2):
for k in range(0, 2):
print(new_matrix[0, j].arr)
print(new_matrix[0, j].arr[k].arr)
это даст вам:
#array at position [i, j]
[<__main__.Arr object at 0x102c5bb00> <__main__.Arr object at 0x102c5bc50>]
#array at position k of [i, j]
[1 2 3 4]
[<__main__.Arr object at 0x102c5bb00> <__main__.Arr object at 0x102c5bc50>]
[5 6 7 8]
[<__main__.Arr object at 0x10947bf60> <__main__.Arr object at 0x10951b518>]
[ 1 44 5 66]
[<__main__.Arr object at 0x10947bf60> <__main__.Arr object at 0x10951b518>]
[90 91 93 94]