HOW TO
In ArcGIS Pro, the Get Count geoprocessing tool is used to calculate the total number of rows in an attribute table. However, this tool does not calculate the total number of columns, which represents the total number of fields in a feature class.
Providing a method to calculate this is helpful when there is a large number of attributes in a feature class. This is achieved using the Python ListFields() function.
Follow the workflow below to calculate the total number of fields in a feature class using the Python ListFields() function.
import arcpy fields = arcpy.ListFields('Feature Class Name') print(len(fields))
Note: Do not remove the single quotation marks enclosing the feature class name.
In this example, the feature class is Asia.
Article ID: 000023096
Get help from ArcGIS experts
Download the Esri Support App