ignore Null Values when iterating through fields with python

المشرف العام

Administrator
طاقم الإدارة
So far I have a code which iterates through Fefature Classes and ignores all fields of type String, Geometry and OID.

I now try to add some lines which tell python to ignore all NULL values when looping through an integer/float/double field. I work with ArcGIS 10.1 Any ideas how to do so? I believe it must be with MakeFeatureLayer_management but I do not know how.

FCs = arcpy.ListFeatureClasses() # loop through all Featurecalsses in env.workspace for FCLASS in FCs: #Skip all Text. OID and Geometry Fields - unfortunately fields called WID, Shape Area etv is still included AllFields = [f.name for f in arcpy.ListFields(FCLASS)] LeaveOutField = [f.name for f in arcpy.ListFields(FCLASS,field_type='String')] LeaveOutField.extend([f.name for f in arcpy.ListFields(FCLASS,field_type='Geometry')]) LeaveOutField.extend([f.name for f in arcpy.ListFields(FCLASS,field_type='OID')]) attrlist = [x for x in AllFields if x not in LeaveOutField]

أكثر...
 
أعلى