title: arcpy TypeError: 'float' object is not iterable
body: <p>Trying to do some seemingly simple field calculations via UpdateCursor in ArcGIS 10.1 and getting an error about not being able to iterate floats. Here's my code--some stuff is commented out b/c it's not important to my question so just ignore it.</p>
  
  <pre><code>    #import arcpy module
      import arcpy
  
      #doing some fancy math
      import math
  
  #message to let you know the script started
  print "Begin Field Calculation for age-adjusted-rate."
  
  #input shapefile
  inputFC = 'C:\\blahblah.shp'
  
  #variable to define the new field name
  Field_Name = ['Age_Adj_R', 'wt_1', 'wt_2', 'wt_3']
  
  #add the new Fields
  #arcpy.AddField_management(inputFC, Field_Name[0], "DOUBLE", "", "", "", "",        "NULLABLE", "NON_REQUIRED", "")
  #arcpy.AddField_management(inputFC, Field_Name[1], "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")
  #arcpy.AddField_management(inputFC, Field_Name[2], "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")
  #arcpy.AddField_management(inputFC, Field_Name[3], "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")
  
  #list variable for the fields in the table that will be used
  fields = ["Cnt1", "Cnt2", "Cnt3", "Pop1", "Pop2", "Pop3", "Crude_Rate", "Age_Adj_R", "wt_1", "wt_2", "wt_3"]
  #wt_age_avg = [0.2869, 0.5479, 0.1652]
  
  #populate the weighted average fields
  cursor = arcpy.da.InsertCursor(inputFC, ["wt_1", "wt_2", "wt_3"])
  for x in xrange(0, 51):
      cursor.insertRow([0.2869, 0.5479, 0.1652])
  del cursor
  
  #function to perform the field calculation using an update cursor
  with arcpy.da.UpdateCursor(inputFC, fields) as cursor:
  for row in cursor: #iterate through each row
      if not -99 in row: #check for missing values
          row[7] = str(sum((row[6]) * ((row[0] * row[8]) + (row[1] * row[9]) + (row[2] * row[10]))) #do the calculation
      else:
          row[7] = 0 #missing values found, place a null response
      cursor.updateRow(row) #save the calculations
  del row  #release the variables
  
  #acknowledge completion
     print "Calculation Completed."
  </code></pre>
  
  <p>error in IDLE:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\blahblah.py", line 48, in &lt;module&gt;
      row[7] = str(sum((row[6]) * ((row[0] * row[8]) + (row[1] * row[9]) + (row[2] * row[10])))) #do the calculation
  TypeError: 'float' object is not iterable
  </code></pre>
  
  <p>Ok--but I thought I changed it to a string before it would even populate the fields....I have no idea how to get this calculation to work. It should look something like:</p>
  
  <p>sum(crude_rate* sum(weighted_averages))</p>
  
  <p>If my way of using constant value fields doesn't work, I have also tried passing the values as variables (see variable: wt_age_avg) without luck. Also using other summation functions like math.fsum didnt' work either.</p>