<?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: Reclassify in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/reclassify/m-p/332065#M25824</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like the code that you posted shows the part that is working, which is one raster at a time. I suggest posting the code that is causing issue. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Oct 2014 13:14:06 GMT</pubDate>
    <dc:creator>DallasShearer</dc:creator>
    <dc:date>2014-10-15T13:14:06Z</dc:date>
    <item>
      <title>Reclassify</title>
      <link>https://community.esri.com/t5/python-questions/reclassify/m-p/332064#M25823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is just a small test of what I am trying to do but when I try and reclassify (code below) I get a value of 50 when this particular raster should have the value of 9 (for 2014)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This happens when I iterate through rasters in ModelBuilder UNLESS I reclassify 1 raster at a time, then I get the correct value of 9 and the field with 2014 remains in the attribute table (disappears when I get 50 as a value when using ModelBuilder and Python).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Year is stored as text and raster's were derived from polylines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

import arcpy, os, traceback
from arcpy import env
from arcpy.sa import *


try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.overwriteOutput = True
&amp;nbsp;&amp;nbsp;&amp;nbsp; env.workspace = "C:/Risk2014/Rasters2014"
&amp;nbsp;&amp;nbsp;&amp;nbsp; inras = "siu140030a"
&amp;nbsp;&amp;nbsp;&amp;nbsp; remap = RemapValue([["2014", 9],["2013", 8]])


&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CheckOutExtension("Spatial")


&amp;nbsp;&amp;nbsp;&amp;nbsp; outReclass1 = Reclassify(inras, "STI_YR", remap, "NODATA") # Field STI_YR = 2014 in this example
&amp;nbsp;&amp;nbsp;&amp;nbsp; outReclass1.save("C:/Risk2014/TestReclass/rsiu140030a")
&amp;nbsp;&amp;nbsp;&amp;nbsp; os.startfile("U:\Projects\Risk\RiskTables.mxd")
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; traceback.print_exc()



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got this code to work but have not checked it when iterating, will let everyone know&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

import arcpy, os, traceback


try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.overwriteOutput = True
&amp;nbsp;&amp;nbsp;&amp;nbsp; inras = "C:\\Risk2014\\Rasters2014\\siu140030a"
&amp;nbsp;&amp;nbsp;&amp;nbsp; outras = "C:\\Risk2014\\TestReclass\\rsiu140030a"
&amp;nbsp;&amp;nbsp;&amp;nbsp; remap = "'2014' 9;'2013' 8"


&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CheckOutExtension("spatial")


&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.gp.Reclassify_sa(inras, "STI_YR", remap, outras, "DATA")
&amp;nbsp;&amp;nbsp;&amp;nbsp; os.startfile("U:\Projects\Risk\RiskTables.mxd")
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; traceback.print_exc()

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:43:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/reclassify/m-p/332064#M25823</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2021-12-11T15:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Reclassify</title>
      <link>https://community.esri.com/t5/python-questions/reclassify/m-p/332065#M25824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like the code that you posted shows the part that is working, which is one raster at a time. I suggest posting the code that is causing issue. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2014 13:14:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/reclassify/m-p/332065#M25824</guid>
      <dc:creator>DallasShearer</dc:creator>
      <dc:date>2014-10-15T13:14:06Z</dc:date>
    </item>
  </channel>
</rss>

