You can use +
to concatenate strings as per the accepted answer.
To expand a bit on what caused your syntax error - join
is a method of a string object and is used to concatenate elements of an iterable (list, tuuple, etc) with that string.
i.e.
' '.join(['x', 'y', 'z'])
x y z
', '.join(['x', 'y', 'z'])
x, y, z
d = ' | '
d.join(['x', 'y', 'z'])
x | y | z
Using +
is perfectly fine, but you might want to consider .join
when you have lots of things to join or your list of things to join might not always be the same length.
So to get your original expressions working in the field calculator, you could use:
''.join([!GRID1MIL!, !GRID100K!])
Or (in the code block):
def addIt(a,b)
return ''.join([a,b])
addIt(!GRID1MIL!, !GRID100K!)