我想转换当前输入:
a = [[[], [], [], [], [], [], []], [[], [], [], [], [], [], [], []]]
类似于coo_matrix:
[ (0,0) []
(0,1) []
.
.
.
.
.
.
.
.
.
.
(x,y)
]
代码:
for i,x in enumerate(a):
for ii, xx in enumerate(x): #Anyway to shorten this part to search that it has 2 indices?
for iii,xxx in enummerate(xx):
coo_matrix(([],(ii,iii)))
我尝试了许多其他方法,但是所有方法都返回一个列表,而不返回coo_matrix