palpen
8/26/2016 - 10:33 PM

Checks that feature classes in a list all have the same number of observations in their attribute tables #python#arcpy#gis

Checks that feature classes in a list all have the same number of observations in their attribute tables #python#arcpy#gis

fc_row_count = []

for fc in feature_class_list:

    countrows_result = ap.GetCount_management(fc)
    count = int(countrows_result.getOutput(0))
    fc_row_count.append(count)

same_count = fc_row_count.count(fc_row_count[0]) == len(fc_row_count)

if same_count:
    
    print "All feature classes in feature_class_list have the same number of observations "

else:

    print "At least one feature class have a different number of observation from the other feature classes"
    sys.exit()