I have developed a python script to copy and paste in the field calculator. Having an input of three values, it compares all of them and returns a list of unique values. The problem is that when I use it in ArcMap, it only returns the first result for all the rows, even they should be different. Then, how can I evaluate each row?
Here is the code:
index = 0
list_yes = []
def myFunc(var_1,var_2,var_3):
global list_yes
global index
myList_1 = [var_1,var_2,var_3]
for i in myList_1:
myList_2 = myList_1[index:]
for j in myList_2:
if i == j:
if not j:
pass
else:
list_yes.append(j)
elif not j:
pass
else:
pass
index = index +1
list_set = set(list_yes)
unique_list = list(list_set)
return str(unique_list)
str
of the list? – Paul H Apr 1 '19 at 18:39