3

I've been looking at the ArcGIS resources for python but I can't seem to figure this one out.
I'm looking for a method to gain access to the number of fields that are within a shapefile / feature class. Is this information available via Python?

10

Use arcpy.Describe.

fieldcount = len(arcpy.Describe(featureClass).fields)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.