Solved! Go to Solution.
import arcpy, inRaster = r"C:\test.gdb\myRaster" # Build attribute table if needed #arcpy.BuildRasterAttributeTable_management(inRaster, "OVERWRITE") # Create a search cursor for desired raster VALUE sCur = arcpy.SearchCursor(inRaster, '"VALUE" = 1') for row in sCur: cellCount = row.getValue("COUNT") print cellCount
import arcpy, inRaster = r"C:\test.gdb\myRaster" # Build attribute table if needed #arcpy.BuildRasterAttributeTable_management(inRaster, "OVERWRITE") # Create a search cursor for desired raster VALUE sCur = arcpy.SearchCursor(inRaster, '"VALUE" = 1') for row in sCur: cellCount = row.getValue("COUNT") print cellCount