TypeError: ‘NoneType’ object is not iterable using Zonal Statistics
I’m trying do looping zonal statistics to many polygons in a folder, and rasters in aonther folder. Each polygon from a specific folder need to get the mean values from a many rasters from another folders, like slope, standard deviation, etc. But when I run this code the error is:
Traceback (most recent call last):
File “D:/ZONAL1.py”, line 10, in
for shp in shapefiles:
TypeError: ‘NoneType’ object is not iterable
What this means?
import arcpy import os arcpy.env.workspace = r'D:pontos_modelagembuffers' arcpy.env.workspace = r'D:slopes' arcpy.env.overwriteOutput = True output = "D:tractebelpontos_modelagembufferdbf" rasters = arcpy.ListRasters() shapefiles = arcpy.ListFeatureClasses() for shp in shapefiles: for rst in rasters: table_out = output + "\" + shp + "_Zonal_Est" arcpy.gp.ZonalStatisticsAsTable_sa(shp,'FID',rst, table_out,"MEAN")