<?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: Very simple code, don't understand the error in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/very-simple-code-don-t-understand-the-error/m-p/559564#M43746</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It converts a path to a raster into a raster object that allows you to the substract the rasters with the need to use the Minus tool.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Jan 2018 21:20:04 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2018-01-30T21:20:04Z</dc:date>
    <item>
      <title>Very simple code, don't understand the error</title>
      <link>https://community.esri.com/t5/python-questions/very-simple-code-don-t-understand-the-error/m-p/559561#M43743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, just trying to run a simple code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy&lt;BR /&gt;... arcpy.CheckOutExtension("Spatial")&lt;BR /&gt;... arcpy.env.workspace = "C:\stuff\SCHISM_SLR_stuff\Con_Rasters\Con_0625"&lt;BR /&gt;... allRasters = arcpy.ListRasters("*","TIF")&lt;BR /&gt;... for eachRaster in allRasters:&lt;BR /&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp; theRaster = Raster(eachRaster)&lt;BR /&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp; outRaster = 6.25 - theRaster&lt;BR /&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp; outRaster.save(eachRaster.replace('.tif','_Final.tif'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error is:&lt;BR /&gt;Runtime error &lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt; File "&amp;lt;string&amp;gt;", line 6, in &amp;lt;module&amp;gt;&lt;BR /&gt;NameError: name 'Raster' is not defined&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help!&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2018 20:59:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/very-simple-code-don-t-understand-the-error/m-p/559561#M43743</guid>
      <dc:creator>DanielSchatt</dc:creator>
      <dc:date>2018-01-30T20:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Very simple code, don't understand the error</title>
      <link>https://community.esri.com/t5/python-questions/very-simple-code-don-t-understand-the-error/m-p/559562#M43744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It should be "arcpy.Raster" instead of "Raster"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also put an r before the workspace location:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\stuff\SCHISM_SLR_stuff\Con_Rasters\Con_0625"&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2018 21:12:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/very-simple-code-don-t-understand-the-error/m-p/559562#M43744</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-01-30T21:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Very simple code, don't understand the error</title>
      <link>https://community.esri.com/t5/python-questions/very-simple-code-don-t-understand-the-error/m-p/559563#M43745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What command is "Raster" supposed to be?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2018 21:12:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/very-simple-code-don-t-understand-the-error/m-p/559563#M43745</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-01-30T21:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Very simple code, don't understand the error</title>
      <link>https://community.esri.com/t5/python-questions/very-simple-code-don-t-understand-the-error/m-p/559564#M43746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It converts a path to a raster into a raster object that allows you to the substract the rasters with the need to use the Minus tool.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2018 21:20:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/very-simple-code-don-t-understand-the-error/m-p/559564#M43746</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-01-30T21:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Very simple code, don't understand the error</title>
      <link>https://community.esri.com/t5/python-questions/very-simple-code-don-t-understand-the-error/m-p/559565#M43747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Xander!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2018 21:35:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/very-simple-code-don-t-understand-the-error/m-p/559565#M43747</guid>
      <dc:creator>DanielSchatt</dc:creator>
      <dc:date>2018-01-30T21:35:08Z</dc:date>
    </item>
  </channel>
</rss>

