import arcpy arcpy.CheckOutExtension("spatial") arcpy.env.workspace = "F:\\ECV\\netCDFtoRaster" arcpy.env.overwriteOutput = True for year in range(1990,2010): # 1990 through 2010 for month in range(13): # 1 to 12 # wildcard - "ECV_SM_MERG_{1:02d}*.TIF" (format month 1 -> "01") wild = "ECV_SM_MERG_{1:02d}*.TIF".format(year, month) rasters = arcpy.ListRasters(wild) # list all rasters for a month output = "F:\\ECV\\Month_"+str(month)+"_"+str(year)+".tif" for raster in rasters: # Process: Cell Statistics print (rasters) arcpy.gp.CellStatistics_sa(rasters, output, "MEAN", "DATA")
Solved! Go to Solution.
shouldn't the last four lines be indented as well?