를 첨자에되지 않는다 'itertools.combinations'개체 :형식 오류 : 나는 실행하려고하면
temp = (twoset2[x][i][0]-twoset[x][i][1])
를 내가 얻을 :
TypeError: 'itertools.combinations' object is not subscriptable
내 코드 : 기본적으로
for x in range(0,64):
for i in range(0,1):
temp = (twoset2[x][i][0]-twoset[x][i][1])
DSET[counter2]= temp
temp = 0
counter2 += 1
내가 내가하려고하는 일은 : 좌표의 2 요소 하위 집합 (예 : ((2,0) (3,3)
)의 목록 (twoset2
)이 있습니다. 각 개별 좌표에 액세스하고 x
과 y
사이의 차이를 가져와 DSET
에 넣고 실행하려고 할 때 위의 오류가 발생합니다.
도와주세요!
어디'itertools.combinations이다()'코드에서? – GLHF