Skip to content

Instantly share code, notes, and snippets.

@KHwong12
Last active May 14, 2019
Embed
What would you like to do?
# The hexagon bin feature class and the related fields
table = 'hex_bins_MYS'
fields = ["Matsuya","Yoshinoya","Sukiya","Max_No","MainChain"]
with arcpy.da.UpdateCursor(table, fields) as cursor:
for row in cursor:
Mainchain = ""
for column_no in range(3):
if row[column_no] == row[3]:
Mainchain += fields[column_no][0]
else:
Mainchain += "-"
print(Mainchain)
row[-1] = Mainchain
cursor.updateRow(row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment