Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

Any help would be appreciated.

Rob Smith

share|improve this question
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
add comment

1 Answer

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
share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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