Hi Nick,I think the problem here is that your values might be stored as numbers.!SLOPE!.replace('999', '0')
would work perfectly well with strings. The thing is, replace is a string method and so needs an input that is such.Your easiest (though sloppiest IMO) option would be to do something like:int(str(!TNODE_!).replace('10','00'))
which converts your number to a string, executes the replace method, and then converts the result back into an integer (or float, or whatever you need.)Something more structured that would allow more flexibility in your logic would involve using the Codeblock in the Field Calculator, where the Code Block would be:def quick_check(val):
if val == 999:
return 0
return val
and your main expression would beSLOPE =quick_check(!SLOPE!)
In this way, you're passing the value in SLOPE to the function above, which returns 0 if it's 999, or the regular value if it's not.Hope this helps!Marc