cell stats for many folders

Discussion created by slburns on Jun 19, 2011
Latest reply on Jun 20, 2011 by slburns
I have a main folder with many folders and each folder contains many rasters. I would like to run cell stats in each folder and output the cell stats in each of the folders.
I can get cell stats to work on one folder if I point it in that direction but I am not sure how to make the code run through each folder with out me pointing it there.
I have had a go:
import arcpy
from arcpy import env
from import *
import os

env.workspace = "D:\groupedFFDI_Rasters\Seasons"

for foldernames in folderList:
    print foldernames
    rasterlist = []
    for rasters in arcpy.ListRasters():
        print rasters
        outcellstats1 = CellStatistics(rasterlist, "MEAN", "DATA")
        print rasters,foldernames, "MEANall.img"))

print "end of processing"