I have gotten stuck on seemingly simple ArcGIS field calculator python expression.
I obtained a great answer to a another similar question a few years ago: Using Range in Python expression of ArcGIS Field Calculator?. Now I need to populate a new field based on 6 ranges of values (bedrock depth).
My attempt at writing this expression is below:
I just need to populate the empty field "bedrockdp" using the ranges in the toc called brockdepmin.
Pre-Logic Script Code:
def !GRIDCODE! (value):
if value >0 and value < 50:
return "0 - 50 cm from the surface"
else:
return "n/a"
bedrockdep =
GRIDCODE (!bedrockdep!)