<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:14pt;color:#000000;"><DIV></DIV>
<DIV>Dear all, kindly help me with this code;</DIV>
<DIV> </DIV>
<DIV>This script  is supposed to calculate Rvi for each row by first summing the product of #fields (Ai*Rv) and dividing by another field (Tot) such that  Rvi=sum(Ai*Rv)/Tot. First it's acting like I need another parenthesis and it doesn't seem to work at all. i even imported the math module, but not sure if a need it. Please advice, your help is highly appreciated.  Please see the code below:<BR></DIV>
<DIV>import arcpy, math<BR>arcpy.Workspace = "C:\\data\\basins.mdb"<BR>fc = "wshed"</DIV>
<DIV>sum = 0<BR>        <BR># Create the update cursor and advance the cursor to the first row<BR>cur = arcpy.UpdateCursor(fc)<BR>row = cur.Next()</DIV>
<DIV># Perform the update and move to the next row as long as there are<BR>#  rows left<BR>for row:<BR>    row.GetValue(Rvi) = sum(row.Ai*row.Rv)/row.ATot<BR>    cur.UpdateRow(row)<BR>    row = cur.Next()<BR># Delete the cursors to remove any data locks<BR>del row, cur  </DIV></div><br>

      </body></html>