<?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: Multiplication raster by table in Spatial Statistics Questions</title>
    <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611183#M1963</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Xander,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course - please see below. I have emboldened the changes that I made to the original code that you posted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy,os
... &lt;STRONG&gt;arcpy.env.workspace = "C:\A\B\Test\TIMESLOOKUP.gdb"
... arcpy.env.scratchWorkspace = "C:\A\B\Test\TIMESLOOKUP.gdb"&lt;/STRONG&gt;

... inWS = r'C:\A\B\C\EucDistRasters' # input rasters are stored here
... outWS = r'C:\A\B\Test\' # output rasters will be stored here
... 
... tbl = 'LOOKUP$'
... fldName1 = 'A' # field with output raster name (no path included)
... fldName2 = 'B' # field with input raster name (no path included)
... fldName3 = 'C' # multiply value field
... 
... fields = [fldName1,fldName2,fldName3]
... with arcpy.da.SearchCursor(tbl, fields) as cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value_from_row = row[2]
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inName = row[1]
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outName = row[0]
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inRasLoc = os.path.join(inWS,inName)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inRas = arcpy.Raster(inRasLoc)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = inRas * value_from_row
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outRasLoc = os.path.join(&lt;STRONG&gt;outWS&lt;/STRONG&gt;,outName)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result.save(outName)
... 
... del row, inRas, tbl&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best wishes,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 02:08:53 GMT</pubDate>
    <dc:creator>MatthewJones3</dc:creator>
    <dc:date>2021-12-12T02:08:53Z</dc:date>
    <item>
      <title>Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611174#M1954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm looking for the easiest way to multiply raster by the table records. Here's what I mean in details:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) raster (DEM) - further called as "input_DEM"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) specified numeric values stored in a table in 1 column - further called as "value_from_n_row", where 'n' is the row number&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to create a few new rasters by this way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"input_DEM" * "value_from_1_row" = "output_raster_1"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"input_DEM" * "value_from_2_row" = "output_raster_2"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"input_DEM" * "value_from_3_row" = "output_raster_3"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If there's a way to do this automatically? Sorry if my question is trivial, but I didn't found any solution yet.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any support! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Oct 2013 19:32:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611174#M1954</guid>
      <dc:creator>MarcinNowak</dc:creator>
      <dc:date>2013-10-20T19:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611175#M1955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I'm looking for the easiest way to multiply raster by the table records. Here's what I mean in details:&lt;BR /&gt;&lt;BR /&gt;I have:&lt;BR /&gt;1) raster (DEM) - further called as "input_DEM"&lt;BR /&gt;2) specified numeric values stored in a table in 1 column - further called as "value_from_n_row", where 'n' is the row number&lt;BR /&gt;&lt;BR /&gt;I need to create a few new rasters by this way:&lt;BR /&gt;"input_DEM" * "value_from_1_row" = "output_raster_1"&lt;BR /&gt;"input_DEM" * "value_from_2_row" = "output_raster_2"&lt;BR /&gt;"input_DEM" * "value_from_3_row" = "output_raster_3"&lt;BR /&gt;etc.&lt;BR /&gt;&lt;BR /&gt;If there's a way to do this automatically? Sorry if my question is trivial, but I didn't found any solution yet.&lt;BR /&gt;&lt;BR /&gt;Thanks for any support! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Marcin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is standard tool that does the job. It is however pretty straight forward to do this in Python. See the code snippet below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy import os&amp;nbsp; dem = arcpy.Raster('Input_DEM') tbl = 'YourTableName' fldName = 'YourFieldName' outFolder = r'c:\folder\subfolder'&amp;nbsp; fields = [fldName] cnt=0 with arcpy.da.SearchCursor(fc, fields) as cursor: &amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value_from_row = row[0] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cnt+=1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outName = outFolder + os.sep + "dem_{0}".format(cnt) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = dem * value_from_row &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result.save(outName)&amp;nbsp; del row del dem del tbl&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In this code the following assumptions are made (basically to keep the code simple):&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;environment settings are specified correctly (workspace, cell size, extent, ...)&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;spatial analyst extension is enabled&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;the table ("YourTableName")&amp;nbsp; and DEM ("Input_DEM") are in the TOC&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;the values are stored in field "YourFieldName"&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;SPAN&gt;Change the "YourTableName" and the name of the DEM "Input_DEM" to the actual name of the objects in the TOC. Also change the "YourFieldName" to the actual name of the field in your table holding the values you want to use. Also specify a valid output folder (or file geodatabase) to store the resulting rasters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What happens in the code is that for each value in your table a new raster is created by multiplying the DEM with that value. The resulting raster is stored in your output folder with the name "dem_#" (where "#" is a consecutive number).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code can be executed from the Python window. You can read more about this in the Help topic "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.2/index.html#/What_is_the_Python_window/002100000017000000/" rel="nofollow" target="_blank"&gt;What is the Python window?&lt;/A&gt;&lt;SPAN&gt;". &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code makes use of arcpy data access module which is available from version 10.1. You can also use a &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v00000039000000" rel="nofollow" target="_blank"&gt;"normal" search cursor&lt;/A&gt;&lt;SPAN&gt; to loop through the values in the table. This a also available in version 10.0, but the syntax is different.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xander&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 06:10:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611175#M1955</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2013-10-21T06:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611176#M1956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Xander,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you for your answer. Unfortunately, I have a problem with the code. I'm getting the message like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Runtime error
Traceback (most recent call last):
&amp;nbsp;&amp;nbsp;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;
NameError: name 'fc' is not defined&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I changed all the names of objects, there are in TOC as well. Sorry if I'm doing something wrong. Could you explain me this problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards and once more again - thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Marcin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:41:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611176#M1956</guid>
      <dc:creator>MarcinNowak</dc:creator>
      <dc:date>2021-12-12T16:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611177#M1957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Marcin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry, my bad. I had an error in the code. The line that states:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;with arcpy.da.SearchCursor(&lt;STRONG&gt;fc&lt;/STRONG&gt;, fields) as cursor:&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;... should actually be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;with arcpy.da.SearchCursor(&lt;STRONG&gt;tbl&lt;/STRONG&gt;, fields) as cursor:&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In many samples "fc" is used as variable to refer to a featureclass and I forgot to change it to "tbl".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xander&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 19:19:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611177#M1957</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2013-10-21T19:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611178#M1958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Now everything works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for help&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Marcin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 09:35:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611178#M1958</guid>
      <dc:creator>MarcinNowak</dc:creator>
      <dc:date>2013-10-22T09:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611179#M1959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for posting, Xander. I have similar requirements to Marcin, but I with some complications. Firstly, I want the input raster (DEM in Marcin's example) to be multiplied only by values in which another field (column 2) of the table matches the filename of the input raster. Secondly, I want the output file to assume the name of another field of the table (values in column 1). And thirdly, I have multiple input rasters and would like to automate the process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To expand on Marcin's helpful input-output map:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"input_ras" * "value_from_r&lt;X&gt;c_[3]" (IF "value_from_r&lt;X&gt;c[2]" = "input_raster_filename") = "[value_from_r&lt;X&gt;c[1]"&lt;/X&gt;&lt;/X&gt;&lt;/X&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;where r[] = row &amp;amp; c[] = column/field of the table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way to do all of these things in python? I would really appreciate any help!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 07:42:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611179#M1959</guid>
      <dc:creator>MatthewJones3</dc:creator>
      <dc:date>2013-12-05T07:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611180#M1960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Matthew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I understand this correctly it could look like the code below. I assumed the following things:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;you have an input folder or fgdb (&lt;STRONG&gt;inWS&lt;/STRONG&gt;) where your input rasters are stored&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;fldName1 holds the name of the output raster (no path to folder of fgdb included)&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;fldName2 holds the name of the input raster (stored in &lt;STRONG&gt;inWS&lt;/STRONG&gt;)&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;fldName3 is numeric&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;output rasters will be written to the output folder of fgdb &lt;STRONG&gt;outWS&lt;/STRONG&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;SPAN&gt;The code will need some small changes in case your fields include locations too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy,os

inWS = r'c:\path\to\input\folder\or\filegdb.gdb' # input rasters are stored here
outWS = r'c:\path\to\output\folder\or\filegdb.gdb' # output rasters will be stored here

tbl = 'YourTableName'
fldName1 = 'YourFieldName1' # field with output raster name (no path included)
fldName2 = 'YourFieldName2' # field with input raster name (no path included)
fldName3 = 'YourFieldName3' # multiply value field

fields = [fldName1,fldName2,fldName3]
with arcpy.da.SearchCursor(tbl, fields) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value_from_row = row[2]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inName = row[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outName = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inRasLoc = os.path.join(inWS,inName)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inRas = arcpy.Raster(inRasLoc)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = inRas * value_from_row
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outRasLoc = os.path.join(outFolder,outName)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result.save(outName)

del row, inRas, tbl&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xander&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:08:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611180#M1960</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-12T02:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611181#M1961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks so much for responding so quickly, Xander. Extremely helpful! And yes, the assumption that you listed are correct - sorry if my question could have been more clear. Unfortunately I am getting the following error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RuntimeError: ERROR 010240: Could not save raster dataset to C:\""\""\'SCRATCHWORKSPACE'.gdb\"OutName" with output format FGDBR&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you aware of any work-around?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 09:48:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611181#M1961</guid>
      <dc:creator>MatthewJones3</dc:creator>
      <dc:date>2013-12-05T09:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611182#M1962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Matthew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you post your code using the "#" button? It is probably the way the workspace is defined.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards, Xander&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 09:50:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611182#M1962</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2013-12-05T09:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611183#M1963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Xander,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course - please see below. I have emboldened the changes that I made to the original code that you posted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy,os
... &lt;STRONG&gt;arcpy.env.workspace = "C:\A\B\Test\TIMESLOOKUP.gdb"
... arcpy.env.scratchWorkspace = "C:\A\B\Test\TIMESLOOKUP.gdb"&lt;/STRONG&gt;

... inWS = r'C:\A\B\C\EucDistRasters' # input rasters are stored here
... outWS = r'C:\A\B\Test\' # output rasters will be stored here
... 
... tbl = 'LOOKUP$'
... fldName1 = 'A' # field with output raster name (no path included)
... fldName2 = 'B' # field with input raster name (no path included)
... fldName3 = 'C' # multiply value field
... 
... fields = [fldName1,fldName2,fldName3]
... with arcpy.da.SearchCursor(tbl, fields) as cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value_from_row = row[2]
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inName = row[1]
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outName = row[0]
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inRasLoc = os.path.join(inWS,inName)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inRas = arcpy.Raster(inRasLoc)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = inRas * value_from_row
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outRasLoc = os.path.join(&lt;STRONG&gt;outWS&lt;/STRONG&gt;,outName)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result.save(outName)
... 
... del row, inRas, tbl&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best wishes,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:08:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611183#M1963</guid>
      <dc:creator>MatthewJones3</dc:creator>
      <dc:date>2021-12-12T02:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611184#M1964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Matt,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When you define a path in a Python script there are 3 ways to do this (maybe more, but these are the most common ones):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
# use "r" before path
myFGDB = &lt;STRONG&gt;r&lt;/STRONG&gt;"C:\A\B\Test\TIMESLOOKUP.gdb"

# use forward slashes
myFGDB = "C:&lt;STRONG&gt;/&lt;/STRONG&gt;A&lt;STRONG&gt;/&lt;/STRONG&gt;B&lt;STRONG&gt;/&lt;/STRONG&gt;Test&lt;STRONG&gt;/&lt;/STRONG&gt;TIMESLOOKUP.gdb"

# use double slashes
myFGDB = "C:&lt;STRONG&gt;\\&lt;/STRONG&gt;A&lt;STRONG&gt;\\&lt;/STRONG&gt;B&lt;STRONG&gt;\\&lt;/STRONG&gt;Test&lt;STRONG&gt;\\&lt;/STRONG&gt;TIMESLOOKUP.gdb"
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So in your code, change this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.env.workspace = r"C:\A\B\Test\TIMESLOOKUP.gdb"
arcpy.env.scratchWorkspace = r"C:\A\B\Test\TIMESLOOKUP.gdb"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.env.workspace = &lt;STRONG&gt;r&lt;/STRONG&gt;"C:\A\B\Test\TIMESLOOKUP.gdb"
arcpy.env.scratchWorkspace = &lt;STRONG&gt;r&lt;/STRONG&gt;"C:\A\B\Test\TIMESLOOKUP.gdb"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The other thing will probably be the table "LOOKUP&lt;/SPAN&gt;&lt;STRONG&gt;$&lt;/STRONG&gt;&lt;SPAN&gt;". Is this by any chance an Excel worksheet? If so, you will have to reference it with its complete path, since it is not in your current workspace (which is a fgdb). If you run this in the Python window of ArcMap and the table is named like that and in your TOC, it might just work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards, Xander&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;BTW: good catch with the &lt;STRONG&gt;outWS&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:08:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611184#M1964</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-12T02:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611185#M1965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Xander,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for another really helpful message. As you can probably tell, I'm very new to python! I have made the changes that you suggest but I'm encountering the same error message. I have also tried closing &amp;amp; reopening excel and ArcMap and reloading it into the TOC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 10:46:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611185#M1965</guid>
      <dc:creator>MatthewJones3</dc:creator>
      <dc:date>2013-12-05T10:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611186#M1966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Matt,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is another line in your code that will create errors:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;outWS = r'C:\A\B\Test&lt;STRONG&gt;\&lt;/STRONG&gt;'&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The folder should not end with a slash. It should be like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;outWS = r'C:\A\B\Test'&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When writing to a folder the format will be an Esri grid (raster). This format has some limitations in naming. The most important are:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;&lt;SPAN style="font-style:italic;"&gt;The maximum number of characters is 13.&lt;/SPAN&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;LI&gt;&lt;SPAN style="font-style:italic;"&gt;It cannot have spaces.&lt;/SPAN&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;SPAN style="font-style:italic;"&gt;It cannot use special characters other than underscore ( "_" ).&lt;/SPAN&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;SPAN style="font-style:italic;"&gt;The total length of the name for a Grid and its path cannot be more than 128 characters.&lt;/SPAN&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;SPAN&gt;You can read more about this in the Help topic on "&lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//018700000009000000"&gt;Output raster formats and names&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you attach a screen shot of the Excel file you're using? I would like to see what output names are assigned.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xander&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2013 04:33:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611186#M1966</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2013-12-06T04:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611187#M1967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Xander,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please find below a screenshot of the first 12 rows of data. The first two columns are string and the third is numeric. The output names in column 1 are formatted as [year][month]_[inRaster]. There is an output name for each month of 2009 for each of the 126 input rasters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your continued help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2013 07:15:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611187#M1967</guid>
      <dc:creator>MatthewJones3</dc:creator>
      <dc:date>2013-12-06T07:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611188#M1968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Matt,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have seen issues with Esri grids that have a name starting with a number. Could you add a character at the beginning of the name (like: "&lt;/SPAN&gt;&lt;STRONG&gt;R&lt;/STRONG&gt;&lt;SPAN&gt;200905_001")? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also see that the fields are named "Name", "AP" and "Q" when in the code you provided you address them as "A", "B" and "C". A, B and C and used in Excel but aren't the field names in ArcMap. Open the table in ArcMap and see what they are called. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Change:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;fldName1 = '&lt;STRONG&gt;A&lt;/STRONG&gt;'
fldName2 = '&lt;STRONG&gt;B&lt;/STRONG&gt;'
fldName3 = '&lt;STRONG&gt;C&lt;/STRONG&gt;'&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;fldName1 = 'Name'
fldName2 = 'AP'
fldName3 = 'Q'&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If that doesn't work run the code below and post the text that is printed to the thread (it prints out a few rows of your data and what input and output will be used).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy,os
inWS = r'C:\A\B\C\EucDistRasters' # input rasters are stored here
outWS = r'C:\A\B\Test' # output rasters will be stored here

tbl = 'LOOKUP$'
fldName1 = 'Name' # field with output raster name (no path included)
fldName2 = 'AP' # field with input raster name (no path included)
fldName3 = 'Q' # multiply value field

fields = [fldName1,fldName2,fldName3]
cnt=0
with arcpy.da.SearchCursor(tbl, fields) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cnt+=1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value_from_row = row[2]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inName = row[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outName = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inRasLoc = os.path.join(inWS,inName)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outRasLoc = os.path.join(outWS,outName)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Name={0}\tAP={1}\tQ={2}\t".format(outName,inName,value_from_row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "&amp;nbsp; - inRasLoc ={0}".format(inRasLoc)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "&amp;nbsp; - outRasLoc={0}".format(outRasLoc)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if cnt &amp;gt; 5:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break

del row, tbl&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xander&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:08:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611188#M1968</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-12T02:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611189#M1969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Xander,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is fantastic - it works! Placing R in front of the output filenames did the job. Thanks so much for your help. Just to clarify, in the code I was running the fields were defined correctly but I just simplified them here to A,B,C for clarity.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not trying to take advantage, but I now have just one more question! - If I now want the base e exponential values of "result", should it be a simple case of adding "Exp" to the 'result' code? I have tried this but it hasn't worked (predictably). I have added import arcpy.sa to the first line of script to allow access to the toolset, but I am sure that I need to define the tool to use at some point in the script ("with arcpy.sa.exp") - I'm just not sure where!!:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy,os,&lt;STRONG&gt;arcpy.sa&lt;/STRONG&gt;
... arcpy.env.workspace = "C:\A\B\Test\TIMESLOOKUP.gdb"
... arcpy.env.scratchWorkspace = "C:\A\B\Test\TIMESLOOKUP.gdb"

... inWS = r'C:\A\B\C\EucDistRasters' # input rasters are stored here
... outWS = r'C:\A\B\Test\' # output rasters will be stored here
... 
... tbl = 'LOOKUP$'
... fldName1 = 'A' # field with output raster name (no path included)
... fldName2 = 'B' # field with input raster name (no path included)
... fldName3 = 'C' # multiply value field
... 
... fields = [fldName1,fldName2,fldName3]
... with arcpy.da.SearchCursor(tbl, fields) as cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value_from_row = row[2]
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inName = row[1]
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outName = row[0]
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inRasLoc = os.path.join(inWS,inName)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inRas = arcpy.Raster(inRasLoc)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = &lt;STRONG&gt;Exp&lt;/STRONG&gt;(inRas * value_from_row)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outRasLoc = os.path.join(outWS,outName)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result.save(outName)
... 
... del row, inRas, tbl&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your help would be greatly appreciated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best wishes,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:09:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611189#M1969</guid>
      <dc:creator>MatthewJones3</dc:creator>
      <dc:date>2021-12-12T02:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611190#M1970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Matt,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry for the delay, but I think the expression is OK, if you change the import statement from:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy,os,arcpy.sa&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy,os
from arcpy.sa import *&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This way the Exp function should be recognized. The alternative could be changing the line to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;result = arcpy.sa.Exp(inRas * value_from_row)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards, Xander&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:09:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611190#M1970</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-12T02:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplication raster by table</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611191#M1971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Xander, I will try this as soon as I get an opportunity and post to confirm if successful, but it doesn't seem as though it will be a problem. Thanks for getting back to me so quickly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All the best,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 09:23:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/multiplication-raster-by-table/m-p/611191#M1971</guid>
      <dc:creator>MatthewJones3</dc:creator>
      <dc:date>2013-12-10T09:23:50Z</dc:date>
    </item>
  </channel>
</rss>

