I have one main folder and it has multiple sub-folder. Each sub-folder has one shapefile. I want to test all fields of the shape file which are having null values. If shape files filed have null values then print the shape file name along with field name.
I have written a code but it only works for one shape file.
import arcpy fc = r'C:\Y4YK\Muni\WX.shp'
fields = dict((f.name, []) for f in arcpy.ListFields(fc) if not f.required)
rows = arcpy.SearchCursor(fc,"","","","")
for row in rows:
for f in fields.keys():
fields[f].append(row.getValue(f))
for field, values in fields.iteritems():
if any(map(lambda s: s is None or not str(s).strip(), values)):
print 'Field: "{}" has empty values'.format(field)
like walk through the folders, listing the featureclasses (shapefiles) and run your function on it?
Walk—Data Access module | Documentation
You add that to your current code