myarray = array([[1,2,3],[0,1,2]])
myarray.shape = (4,3)
结果应如下所示:
MUTAG_graph_struct[0][0]
Out[112]:
(array([[0,0],[1,1],0]],dtype=uint8),array([[(array([[ 5],[22],[ 5],[20]],)]],dtype=[('values','O')]),array([[array([[2]],dtype=uint8)],[array([[1,3,4,5]],[array([[2]],dtype=uint8)]],dtype=object))
result = MUTAG_graph_struct[0][0][2]
所以在我的情况下,我想要像上面那样输出。一个带有数组元素的数组。 然后应该给出:
输出:MUTAG_graph_struct[0][0][2]
array([[array([[1,3]],[array([[0,2]],dtype=object)
您能建议怎么做吗? 我正在使用python3。
我尝试了np.stack
,np.concatenate
,但无法解决问题吗?