# -*- coding:utf8 -*-
import arcpy
import os
from collections import Counter
workspace = r'E:\...\xxxx.gdb'
arcpy.env.workspace = workspace
featureclasses = arcpy.ListFeatureClasses()
for fc in featureclasses:
print(fc)
gidAttList = [] # 宗地代码属性集合集合
with arcpy.da.SearchCursor(fc, ['YJJBNTTBBH', 'SHAPE@']) as cur:
for row in cur:
gidAttList.append(row[0])
b = dict(Counter(gidAttList))
# print ([key for key, value in b.items() if value > 1]) # 只展示重复元素
print ({key: value for key, value in b.items() if value > 1}) # 展现重复元素和重复次数
全部评论