Here is a copy of my script.[ATTACH=CONFIG]26766[/ATTACH]I am attempting to populate a blank field (Veg_Height) in my shapefile attribute table with text of my own choosing depending on the value in field Class_name.e.g. if Class_name = "Grass", change the blank Veg_Height field to "Short", if Class_name = "Trees", change the blank Veg_Height field to "Tall" etc.Unfortunately, at the moment, I keep getting errors when I try to run this in model builder. Can anyone suggest any changes I could make?Thanks 🙂
if row[0] == "Trees": row[1] = "Tall"
if row[0] == "Grass": row[1] = "Short"
curs_dict = { "Grass": "Short", "Trees": "Tall", "Urban": "N/A"} for row in cursor: row[1] = curs_dict[row[0]] cursor.updateRow(row)
Here is a copy of my script.
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.