-1
array =[[[1, 0.25], [1, 0.19], [1, 0.19]], [[1, 0.89], [0, 0.93], [0, 0.48], [1, 0.49], [0, 0.6], [0, 0.6], [1, 0.34]]]
Dieses Array besteht aus zwei Arrays. Ich möchte diese zwei bekommen. Wie könnte ich tun? Das Ergebnis sollte wie folgt:So erhalten Sie das Element in einem Array (Python)
sub1=[[1, 0.25], [1, 0.19], [1, 0.19]]
sub2=[[1, 0.89], [0, 0.93], [0, 0.48], [1, 0.49], [0, 0.6], [0, 0.6], [1, 0.34]]
Der Code ist:
for i in array:
print array[i]
Dann bekam ich:
TypeError: list indices must be integers, not list