ArcGIS 10.2.2 - Which python function should I use to populate a string field based o

المشرف العام

Administrator
طاقم الإدارة
I am new to Python and I'm trying to write a simple if then statement in Field Calculator in ArcGIS 10.2.2 that will take the values from a numeric field and add them to a string field. I can't figure out which python function to use. When i try this code, it works but all values in my text field become "N/A."

This is what I put in the Pre-logic Script Code:

def change(Value): if Value == 1: return "Developed" elif Value == 2: return "Agriculture" elif Value == 3: return "Forested" elif Value == 4: return "Water" elif Value == 5: return "Wetlands" else: return "N/A"




أكثر...
 
أعلى