I am attempting to delete a list of fields in a feature layer but am getting an error:
Execute error: Failed to execute. Parameters are not valid. ERROR 000308 Invalid Field type
Here is a code snippet:
arcpy.MakeFeatureLayer_management(roads, tmprds) arcpy.DeleteField_management(tmprds, ["FIELD_NAME"])
I have listed the fields in my feature layer using:
fclass = tmprds fieldnames = [f.name for f in arcpy.ListFields(fclass)] print (fieldnames)
and I get a list of layers formatted like:
[u'FIELD1', u'FIELD2, u'FIELD3']
I have tried using both IN_MEMORY and real locations which don't seem to make a difference.
Where am I going wrong?