I have a script where I calculate a couple of variables, add a new field then need to do a field calculation that field. Once I get everything set up, it's the expression that I have a hard time figuring out. I am using ArcGIS 10.2
denominator = 0.14
arcpy.CalculateField_management("My_Table", "LQ", ( ( "!Foreign_Born_Population!" / "!Population!" ) / denominator ) , "PYTHON_9.3")
I am thrown an error stating it cannot parse the string but I thought by wrapping the field name in !!
that it would recognize it as a field.
If I were to open the field calculator in the attribute table and type in a function using VB Script, the function would look like:
( [Foreign_Born_Population] / [Population] ) / 0.14
I also tried using the VB Script in the function but that did not work.
I have seen a couple different solutions including with and without using a cursor. Do I need to use a cursor?
How can I write this function?