1

I want to be able to set the value of a field to Null using python, but I get an error. I am using arcpy.CalculateField_management

  • 4
    Can you provide a sample of your code and the error message? – Brian May 9 '13 at 15:42
  • 1
    You do not say what your data format is. If your source dataset is a shapefile then you cannot set the field to Null as dBase format does not support it. – Hornbydd May 9 '13 at 16:31
2

Not using field-calculator, you can use UpdateCursor and setNull. (Arcgis for 10.1)

a quick example:

rows = arcpy.UpdateCursor(fc, sql, etc...)
for row in rows:
    row.SetNull("FIELD")
rows.updateRow(row)
del rows
  • Great!, but I am using Arc 10.0 and we are not moving to 10.1 or awhile. – Rob Smith Jul 16 '13 at 20:26
  • It's about the same in 10.0. The same method will work. – gm70560 Jul 17 '13 at 21:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.