Select to view content in your preferred language

PYTHON

526
5
Jump to solution
03-19-2020 09:37 PM
KalSsin
New Contributor III

Hi~~~~

if arg.endswith("산"):

return 3

Help me please....

0 Kudos
1 Solution

Accepted Solutions
DavidPike
MVP Frequent Contributor

do you have multiple instances of the table open? close down all your ArcGIS applications and open up a fresh mxd then retry.

View solution in original post

0 Kudos
5 Replies
DanPatterson_Retired
MVP Emeritus

return 3  is a number and will produce an error

return "3"  or  return str(3)  .... will return a string representation of a number which you can use in that field

0 Kudos
DavidPike
MVP Frequent Contributor

Hi, try adding an else statement to handle the bulk of the values which don't meet the condition.

def Reclass(arg):
    if arcg.endswith(""):
        return "3"
    else:
        return arg
0 Kudos
KalSsin
New Contributor III

Thank you for your reply.

0 Kudos
DavidPike
MVP Frequent Contributor

do you have multiple instances of the table open? close down all your ArcGIS applications and open up a fresh mxd then retry.

0 Kudos
KalSsin
New Contributor III

There must be an invisible error in the layer.
It's solved by using a different layer.

Thanks for your help.

0 Kudos