I have a CSV file with zero as some of the attribute values. Trying to use cursors and replace all zeros with no data or blank values. I am able to replace any numbers. But not able to update with NULL or no data. The field data type is integer. Tried with Search and Insert cursor, also tried converting to DBF table and then replace zero with null values. Did not work as it seems it is considering null as string. Below is the code
import arcpy
import csv
path= "pm2.5.csv"
fieldObs=arcpy.ListFields(path)
fieldNames= []
for field in fieldObs:
fieldNames.append(field.name)
print(fieldNames)
updateRows = arcpy.da.UpdateCursor(path, fieldNames)
for updaterow in updateRows:
if updaterow =="0"
updaterow is None
curU.updateRow(updaterow)
del updateRow, updateRows