Solved! Go to Solution.
Ideally,the best solution would be to somehow "get into" the zonal statistcs tool through python and change its settings, but I guess that can't be done.
valras = Raster("value_grid.img")
zonras = Raster("zones.img")
outZSaT = ZonalStatisticsAsTable(zonras, "VALUE",
SetNull(valras == 98 or valras == 99, valras)
"stats_tbl", "NODATA", "MEAN")
However, you may want to look into this. Using Python map algebra you can set values to NoData before the tool sees them (no extra raster creation required).
SetNull doesn't create a new raster?
Does it change the original raster permanently?