samedi 26 septembre 2020

How to If statement float comparison in python?

i want to comapare two array. kor,eng each array consists of cid,mapx,mapy.

enter image description here

is kor

enter image description here

is eng i want to append list.

if eng(mapx)==kor(mapx) && eng(mapy)==kor(mpay):
      newlist.append(kor(cid),eng(cid))

so i write a code

for i in eng:
    for k in kor:
        if eng[i][1]==kor[k][1] and eng[i][2]==kor[k][2]:
            samedata.append((eng[i][0],kor[i][0]))

but IndexError: arrays used as indices must be of integer (or boolean) type

how to compare and append?..

Aucun commentaire:

Enregistrer un commentaire