After updating a script from Python 2 to Python 3, I am now getting an 'ERROR 00539: Indentation Error: Unexpected indent <<expression>, line 1' on a line in my script. The line is not indented, and I tried removing all spaces and also re-adding spaces (ensuring no tabs were used). I am not sure where the error is. The line ran without error using Python 2.
This is the original line:
arcpy.CalculateField_management (SubLayer_pp_trans_GUJoin_UniqueSubs, "SUB1SUB2", ' [SUB_1] + "," + [SUB_2] ')
I've tried:
arcpy.CalculateField_management(SubLayer_pp_trans_GUJoin_UniqueSubs,"SUB1SUB2",' !SUB_1! +","+ !SUB_2! ')
and (and various renditions of removing spaces)
arcpy.CalculateField_management(SubLayer_pp_trans_GUJoin_UniqueSubs,"SUB1SUB2",' [SUB_1] + "," + [SUB_2] ')
with no luck. Any suggestions?
Thanks!
Solved! Go to Solution.
I converted it to a question and marked Dan's answer as correct. If you need to change the "correct answer", you should be able to do that now.