I am familiar with using the ArcPy Calculate Field
tool in Python but was wondering how this is done in a stand alone Python script with a .csv
.
My ArcPy Snippet looks like this. I assume it's a basic procedure but I couldn't find any previous questions. Feel free to direct me to a similar question.
codeblock = """def Reclass(PA,dist):
if PA=="M" and dist==1:
return "MM"
elif PA=="M" and dist==0:
return "MW""""
arcpy.CalculateField_management(fc, field="NEW", expression="Reclass(!Field1!,!Field2!)", expression_type="PYTHON_9.3", code_block=codeblock)