Hello,
Am trying to use the calculate field tool in ArcGIS pro and I am not familiar with the python 3 if then statements and how to use the code block. Please can anyone help with some tips on how to do this.
Thanks.
Thank you.
You might also consider trying Arcade. Arcade translates across to the ArcGIS Online environment, popup expressions, etc., and is worth learning.
Calculate Field Python examples—ArcGIS Pro | Documentation
You could use if, elif, else statements. e.g.
Expression: Reclass(!WELL_YIELD!) Code Block: def Reclass(WellYield): if (WellYield >= 0 and WellYield <= 10): return 1 elif (WellYield > 10 and WellYield <= 20): return 2 elif (WellYield > 20 and WellYield <= 30): return 3 elif (WellYield > 30): return 4
.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.