<div>Dear Python Community,</div>
<div> </div>
<div>Table1:</div>
<div>Prop_codeR_Value<br>GC 0.8<br>CI 0.6<br>LDR 0.4<br>HDR 0.6<br>TR 0.65<br>CR 0.35</div>
<div><br>Table 2:<br>O_ID PROP_CODE AI  TArea  R_Value Pre_R_Value IR<br>MER02006 LDR 38.19235 132.3178 0.4 0.115456 0.555143<br>MER02006 TR 20.78983 132.3178 0.65 0.102128 0.555143<br>MER02006 UO 1.850129 132.3178 0.25 0.003496 0.555143<br>
MER03001 GC 16.565  137.592  0.8 0.096314 0.45027</div>
<div>Initially, I manually entered R_Value from table 1 into table 2 in order to later compute subsequent fields using Python. Now I’d like to make the process a bit more automatic. I would like to get R_Values  for each Prop_Code  from table 1 into table 2 so that I can use them in a Table2 computation later on. I was thinking maybe a putting table 1 into a dict then use those values in table 2, but I need help getting started. Just learning Python and dicts are still tricky for me. Please help me modify the code below so that i don't have to repeat the lines of code below for all values of Prop_Code:<br>
import arcpy,sys<br>arcpy.env.workspace = "C:\\test\\DRAINAGE.mdb"<br>Table1= "basins"<br>Table2="CV_Table"<br>cur = arcpy.UpdateCursor(table2, "[PROP_CODE] = 'LDR'")<br>row = cur.next()<br>
# Perform the update and move to the next row as long as there are<br>#  rows left<br>while row:<br>    row.R_Value  = 0 #initialize field from nulls to zero values   <br>    row.R_Value = 0.4 #INstead, I need to get this from Table 2 <br>
    cur.updateRow(row)<br>    row = cur.next()<br># Delete the cursors to remove any data locks<br>del row, cur</div>
<div> </div>
<div>THANKS!!</div>