<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to set reclassification codes as parameters in python script in Transportation Questions</title>
    <link>https://community.esri.com/t5/transportation-questions/how-to-set-reclassification-codes-as-parameters-in/m-p/490484#M1651</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: curtvprice&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I am trying to perform reclassification on a shape file having several attributes[ATTACH=CONFIG]15757[/ATTACH]. I am trying to call this attribute table and "LANDCOVER" column into my python script to perform reclassification.&lt;BR /&gt;&lt;BR /&gt;I am using this python script to perform this:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
fc = "D:\Priyanka\Model_tests\Reclassify_LU_Del\LANDUSE4_prj.shp"
fldName = 'LANDCOVER'
def reclass(landcover):
&amp;nbsp; if landcover in ("Drain", "Lake", "River", "Water Body", "Canal"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Water"
&amp;nbsp; elif landcover in ("Green Area", "Open Space"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Green and Open Space"
&amp;nbsp; elif landcover in ("Island"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Miscellaneous"
&amp;nbsp; elif landcover in ("Others"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Public Space"
&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; return landcover
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;But, I am getting errors "Invalid Syntax". I am sure that I am doing something wrong but dont know what! It would be great if you can please let me know how to perform reclassification on this attribute table and then incorporate the same to ARC Tool!&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To modify field values in a table, you need to use the Calculate Field tool. Fortunately, your nifty function can easily be used there as a code block:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
fc = "D:\Priyanka\Model_tests\Reclassify_LU_Del\LANDUSE4_prj.shp"
fldName = 'LANDCOVER'
newFldName = 'LANDCOV1'
arcpy.AddField_management(fc,newFldName,"TEXT") 
arcpy.CalculateField_management(fc,newFldName,"reclass(!%s!)" % fldName, "PYTHON",
"""
def reclass(landcover):
&amp;nbsp; if landcover in ("Drain", "Lake", "River", "Water Body", "Canal"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Water"
&amp;nbsp; elif landcover in ("Green Area", "Open Space"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Green and Open Space"
&amp;nbsp; elif landcover in ("Island"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Miscellaneous"
&amp;nbsp; elif landcover in ("Others"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Public Space"
&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; return landcover
"""
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can modify this into a script tool by following these instructions in the help:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/A_quick_tour_of_creating_script_tools/001500000006000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;A quick tour of creating script tools&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 21:35:36 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-11T21:35:36Z</dc:date>
    <item>
      <title>How to set reclassification codes as parameters in python script</title>
      <link>https://community.esri.com/t5/transportation-questions/how-to-set-reclassification-codes-as-parameters-in/m-p/490478#M1645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: davisam1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am working on a python script and I would like the user to be able to change the values that get reclassed.&amp;nbsp; If I hard code the remap fields into the code then the program does what it is supposed to do but if I put the part of the code ([11,94,0],[95,95,1]) as a string in the parameters then the code runs but doesn't reclass anything.&amp;nbsp; I've pasted that part of my code below as well as two screengrabs of how I set up the model parameters.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have an example on how to set this up in python (i'm using ArcGIS10) and how to set up the model parameters correctly?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your help in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Amelie&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

# Set the necessary product code
# import arcinfo


# Import arcpy module
import arcpy
from arcpy import env

# Check out any necessary licenses
arcpy.CheckOutExtension("spatial")

###################### Script arguments

Input_Land_Cover__NLCD_2006_ = arcpy.GetParameterAsText(0)
#Input_Land_Cover__NLCD_2006_ = "D:\\DATA\\NLCD\\nlcd2006_cook" # provide a default value if unspecified

Output_Workspace = arcpy.GetParameterAsText(1)
#Output_Workspace = "D:\\DATA\\DELETE" # provide a default value if unspecified

# Set environment settings
env.workspace = Output_Workspace

Zone_values_you_want_to_shrink__LC_code_ = arcpy.GetParameterAsText(2)
#Zone_values_you_want_to_shrink__LC_code_ = "11" # provide a default value if unspecified

Land_Cover_Code_for_which_you_want_to_extract_distance_measure = arcpy.GetParameterAsText(3)
#Land_Cover_Code_for_which_you_want_to_extract_distance_measure = "[11,94,0],[95,95,1]" # provide a default value if unspecified


####################
# could try this: tmp3 = Reclassify(Int(EucDistance(inR, "", "1000", "")), "VALUE", "0 NODATA", "DATA")

# Process: Reclassify
remap = arcpy.sa.RemapRange([Land_Cover_Code_for_which_you_want_to_extract_distance_measure])
nlcd_ag = arcpy.sa.Reclassify(Input_Land_Cover__NLCD_2006_, "VALUE", remap, "DATA")
out_rc1 = Output_Workspace + "\\out1"
nlcd_ag.save(out_rc1)




&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]14222[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]14223[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:35:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/how-to-set-reclassification-codes-as-parameters-in/m-p/490478#M1645</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T21:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to set reclassification codes as parameters in python script</title>
      <link>https://community.esri.com/t5/transportation-questions/how-to-set-reclassification-codes-as-parameters-in/m-p/490479#M1646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;Does anyone have an example on how to set this up in python (i'm using ArcGIS10) and how to set up the model parameters correctly?&amp;nbsp; &lt;BR /&gt; &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could get pretty fancy with parameter validation and such, but to do it the way you're trying to would be pretty straightforward:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
listString = arcpy.GetParameterAsText(3) # "[11,94,0],[95,95,1]" 
# compose a line of python code and run it with exec()
exec("remap = arcpy.sa.RemapRange(%s)" % listString)
# the variable remap now has your remap range for the Reclassify tool
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;An easy way to get the python syntax right for complex functions like this is to run the tool interactively and then open the geoprocessing results, right click the record of your tool run, and "Copy As Python Snippet".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;SPAN&gt; I edited this post to change my advice, but not before Amelie implemented my original suggestion (below), which was to build the lists from input text parameters with the .split() function. The reason I changed my suggesion to what is above is because the reclass input can be very complex and entering string representation of a python list and interpreting it with exec() allows for more flexibility in syntax.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:35:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/how-to-set-reclassification-codes-as-parameters-in/m-p/490479#M1646</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T21:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to set reclassification codes as parameters in python script</title>
      <link>https://community.esri.com/t5/transportation-questions/how-to-set-reclassification-codes-as-parameters-in/m-p/490480#M1647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: davisam1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Worked like a charm.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you greatly,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Amelie&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your code integrated in what I originally posted:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

# Set the necessary product code
# import arcinfo


# Import arcpy module
import arcpy
from arcpy import env

# Check out any necessary licenses
arcpy.CheckOutExtension("spatial")

###################### Script arguments

Input_Land_Cover__NLCD_2006_ = arcpy.GetParameterAsText(0)
#Input_Land_Cover__NLCD_2006_ = "D:\\DATA\\NLCD\\nlcd2006_cook" # provide a default value if unspecified

Output_Workspace = arcpy.GetParameterAsText(1)
#Output_Workspace = "D:\\DATA\\DELETE" # provide a default value if unspecified

# Set environment settings
env.workspace = Output_Workspace

Zone_values_you_want_to_shrink__LC_code_ = arcpy.GetParameterAsText(2)
#Zone_values_you_want_to_shrink__LC_code_ = "11" # provide a default value if unspecified

# In the tool interface you can set defaults
fromClass =&amp;nbsp; arcpy.GetParameterAsText(3)&amp;nbsp;&amp;nbsp; # "11 94 0"
toClass = arcpy.GetParameterAsText(4)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # "95 95 1"

# convert strings to lists of reclass values
# using try/except to handle any syntax problems that come up
try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; fromClassList = fromClass.split()
&amp;nbsp;&amp;nbsp;&amp;nbsp; toClassList = toClass.split()
&amp;nbsp;&amp;nbsp;&amp;nbsp; # convert values to integer
&amp;nbsp;&amp;nbsp;&amp;nbsp; fromClassList = [int(k) for k in fromClassList]
&amp;nbsp;&amp;nbsp;&amp;nbsp; toClassList = [int(k) for k in toClassList]
&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(fromClassList) &amp;lt;&amp;gt; len(toClassList): raise Exception
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; raise Exception, "Invalid input for From and To Classes"


####################

# Process: Reclassify
remap = arcpy.sa.RemapRange([fromClassList,toClassList])
nlcd_ag = arcpy.sa.Reclassify(Input_Land_Cover__NLCD_2006_, "VALUE", remap, "DATA")
out_rc1 = Output_Workspace + "\\out1_f"
nlcd_ag.save(out_rc1)


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:35:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/how-to-set-reclassification-codes-as-parameters-in/m-p/490480#M1647</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T21:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to set reclassification codes as parameters in python script</title>
      <link>https://community.esri.com/t5/transportation-questions/how-to-set-reclassification-codes-as-parameters-in/m-p/490481#M1648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Reclassify is a tricky thing - just wanted to add to the thread that to allow more than two ranges, you could put your range remaps into a single string variable like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"start end newvalue, start end newvalue, start end newvalue"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;These could be converted into a Python list for the RemapRange() function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;rangeText = "0 1 99, 1 2 100"
temp = rangeText.split(",") # split to two strings at the comma
temp = [k.split() for k in temp] # split each remap group into strings
temp = [ [int(j) for j in k] for k in temp]&amp;nbsp; # integerize values&amp;nbsp; &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tested this in a Python window:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;gt;&amp;gt;&amp;gt; rangeText = "0 1 99, 1 2 100"
&amp;gt;&amp;gt;&amp;gt; temp = rangeText.split(",") 
&amp;gt;&amp;gt;&amp;gt; temp
['0 1 99', ' 1 2 100']
&amp;gt;&amp;gt;&amp;gt; temp = [k.split() for k in temp]
&amp;gt;&amp;gt;&amp;gt; temp
[['0', '1', '99'], ['1', '2', '100']]
&amp;gt;&amp;gt;&amp;gt; temp = [ [int(j) for j in k] for k in temp]
&amp;gt;&amp;gt;&amp;gt; temp
[[0, 1, 99], [1, 2, 100]]
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:35:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/how-to-set-reclassification-codes-as-parameters-in/m-p/490481#M1648</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T21:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to set reclassification codes as parameters in python script</title>
      <link>https://community.esri.com/t5/transportation-questions/how-to-set-reclassification-codes-as-parameters-in/m-p/490482#M1649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: davisam1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;even better.&amp;nbsp;&amp;nbsp; Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2012 15:26:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/how-to-set-reclassification-codes-as-parameters-in/m-p/490482#M1649</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-05-11T15:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to set reclassification codes as parameters in python script</title>
      <link>https://community.esri.com/t5/transportation-questions/how-to-set-reclassification-codes-as-parameters-in/m-p/490483#M1650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to perform reclassification on a shape file having several attributes[ATTACH=CONFIG]15757[/ATTACH]. I am trying to call this attribute table and "LANDCOVER" column into my python script to perform reclassification.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using this python script to perform this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; fc = "D:\Priyanka\Model_tests\Reclassify_LU_Del\LANDUSE4_prj.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; fldName = 'LANDCOVER'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; def reclass(landcover):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if landcover in ("Drain", "Lake", "River", "Water Body", "Canal"):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Water"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; elif landcover in ("Green Area", "Open Space"):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Green and Open Space"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; elif landcover in ("Island"):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Miscellaneous"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; elif landcover in ("Others"):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Public Space"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; else:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return landcover&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But, I am getting errors "Invalid Syntax". I am sure that I am doing something wrong but dont know what! It would be great if you can please let me know how to perform reclassification on this attribute table and then incorporate the same to ARC Tool!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2012 10:30:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/how-to-set-reclassification-codes-as-parameters-in/m-p/490483#M1650</guid>
      <dc:creator>PriyankaSharma1</dc:creator>
      <dc:date>2012-07-04T10:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to set reclassification codes as parameters in python script</title>
      <link>https://community.esri.com/t5/transportation-questions/how-to-set-reclassification-codes-as-parameters-in/m-p/490484#M1651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: curtvprice&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I am trying to perform reclassification on a shape file having several attributes[ATTACH=CONFIG]15757[/ATTACH]. I am trying to call this attribute table and "LANDCOVER" column into my python script to perform reclassification.&lt;BR /&gt;&lt;BR /&gt;I am using this python script to perform this:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
fc = "D:\Priyanka\Model_tests\Reclassify_LU_Del\LANDUSE4_prj.shp"
fldName = 'LANDCOVER'
def reclass(landcover):
&amp;nbsp; if landcover in ("Drain", "Lake", "River", "Water Body", "Canal"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Water"
&amp;nbsp; elif landcover in ("Green Area", "Open Space"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Green and Open Space"
&amp;nbsp; elif landcover in ("Island"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Miscellaneous"
&amp;nbsp; elif landcover in ("Others"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Public Space"
&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; return landcover
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;But, I am getting errors "Invalid Syntax". I am sure that I am doing something wrong but dont know what! It would be great if you can please let me know how to perform reclassification on this attribute table and then incorporate the same to ARC Tool!&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To modify field values in a table, you need to use the Calculate Field tool. Fortunately, your nifty function can easily be used there as a code block:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
fc = "D:\Priyanka\Model_tests\Reclassify_LU_Del\LANDUSE4_prj.shp"
fldName = 'LANDCOVER'
newFldName = 'LANDCOV1'
arcpy.AddField_management(fc,newFldName,"TEXT") 
arcpy.CalculateField_management(fc,newFldName,"reclass(!%s!)" % fldName, "PYTHON",
"""
def reclass(landcover):
&amp;nbsp; if landcover in ("Drain", "Lake", "River", "Water Body", "Canal"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Water"
&amp;nbsp; elif landcover in ("Green Area", "Open Space"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Green and Open Space"
&amp;nbsp; elif landcover in ("Island"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Miscellaneous"
&amp;nbsp; elif landcover in ("Others"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Public Space"
&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; return landcover
"""
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can modify this into a script tool by following these instructions in the help:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/A_quick_tour_of_creating_script_tools/001500000006000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;A quick tour of creating script tools&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:35:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/how-to-set-reclassification-codes-as-parameters-in/m-p/490484#M1651</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T21:35:36Z</dc:date>
    </item>
  </channel>
</rss>

