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:
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:
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?