Last active
May 14, 2019 14:25
-
-
Save KHwong12/1356c08aa0b56b2fb814a0e9a2170976 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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