I am trying to do a simple thing, I think, in Python. I am very new to actually trying to write any Python code myself so please have mercy.
I have a script that defines an in-fc and an out-fc. The in-feature is exported to the out_fc. Then there are a bunch of fields that are deleted from the out_fc. Then a field in the out_fc needs to be calculated using 2 fields that exist in the out_fc: STRUCTUREBEG and STRUCTUREEND. The line of code that I am unsuccessfully using is the following:
arcpy.management.CalculateField (out_fc, "PYTHON3", ["SEGMENT"], ["!STRUCTUREBEG!+\" to \"+ !STRUCTUREEND!"])
SEGMENT is the field I want to populate with STRUCTUREBEG and STRUCTUREEND in the format STRUCTUREBEG to STRUCTUREEND. The resulting field should be full of strings like this:
0-1 to 1-1
1-1 to 1-2
1-2 to 1-3
I have gone around and around trying to get the syntax right and my errors just get worse and worse. I think this is simple, but I am not finding a solution. Perhaps someone out there can set me straight?
Thank you in advance for your help.
Caitlin