Hello,
I want to delete all empty fields in a feature class (arcgis pro 3.0 - notebooks) - with no sucess. The following script doesn't work, it prints fields as count = 0 which have valid attributes.
Any better ideas?
fc = "Merge_1"
fields = [f.name for f in arcpy.ListFields(fc) if not f.required]
for field in fields:
count = 0
with arcpy.da.SearchCursor(fc, field) as cursor:
for row in cursor:
if row[0] is None or row[0] in ["", " ", "0"]:
count += 0
else:
count += 1
break
print(field, count)