symbol_weights = { 6: 1.2, 85: 1.5, 2: 1.0, 42: 1.8, 58: 2.0, }
symbol_weights[!SYMBOL!]
Just a suggestion, but if this is part of a Python script, you are WAY better off using an updatecursor instead. The benefit is readability, codeability, and debugging. The code block for the FieldCalculator is notoriously hard to write code for, while the updatecursor has very clear and clean syntax
KLAScodeblock = "If [CMPAREA] <= 1000 Then\\nklasse = 100\\n\\nElseif [MIN] <= "+MDV+" Then \\nklasse = 1\\n\\nElseif [MIN] <= "+MDA+" Then \\nklasse = 2\\n\\nElse \\nklasse = 3\\n\\nEnd If\\n\\n\\n"
This goes in the code block:symbol_weights = { 6: 1.2, 85: 1.5, 2: 1.0, 42: 1.8, 58: 2.0, }
And in the expression field you put:symbol_weights[!SYMBOL!]
Parser: Python Expression: getRandomValue() Code Block: import numpy.random as R def getRandomValue(): return R.random()