Tag Info

Hot answers tagged

6

The simplest way is to create a full list and then remove the ones you don't want: AllFields = [f.name for f in arcpy.ListFields(featureclass)] StringFields = [f.name for f in arcpy.ListFields(featureclass,field_type='String')] NoStringFields = [x for x in AllFields if x not in StringFields ] Which could be compressed onto a single line: ...


1

A complete one-liner would be [f.name for f in arcpy.ListFields(featureclass) if f.type not in ["String"]] You can add more entries to the latter list that you do not want to include, or the ones that you want to include by removing not operator.



Only top voted, non community-wiki answers of a minimum length are eligible