AnsweredAssumed Answered

Replace Multiple Values in an Attribute Table Field using Field Calculator

Question asked by learebs72 on Oct 27, 2017
Latest reply on Oct 28, 2017 by learebs72

I'm new to python and trying to write a python script using the field calculator in ArcMap for a specific field in an attribute table that will replace some of the values in the field but leave the other values as they are within the table. For example: ""fourth" must be changed to "4th" whereas "Neilston" should remain as it is in the field. The field in the table looks like this:

enter image description here

The python script used in the codeblock looks like this:

def streetNUM(field):

  if field == "Fourth":

    field.replace ("Fourth","4th")
  elif field == "Fifth":

    field.replace ("Fifth","5th")
  else:
    return field

And then in the box below the codeblock I have:

streetNUM(!FULLNAME!)

 

Nothing seems to change and I get an error code saying "Field is not nullable [FULLNAME]". Any suggestions as to where I may be going wrong with my code?

Outcomes