I am new to Python and am having trouble figuring out how to reclassify over 500 rasters so that any values are equal to 1 and no data is equal to 0.
Here is my code with the error code at the bottom:
import arcpy
from arcpy import env
arcpy.CheckOutExtension("Spatial")
from arcpy.sa import *
#Set environment settings
env.workspace = "E:/GIS_2017/Shapefiles"
#Set local variables
inputDir = "E:/GIS_2017/Shapefiles/TestRasters/projected"
outputDir= "E:/GIS_2017/Shapefiles/TestRasters/projected/re1"
outputsuffix = "re"
rasList = arcpy.ListRasters()
for raster in rasList:
inRaster = raster
remap = RemapValue([[11002,1],[11004,1],[11005,1],[11006,1],[11007,1],[11009,1],[11015,1],[11013,1],[11014,1],[11016,1],[11019,1],[11029,1],[11030,1],[11036,1],[11043,1],[11044,1],[11046,1],[11048,1],[11049,1],[11050,1],[12039,1],[12040,1],[12042,1],[12123,1],[80002,1],[80003,1],[80004,1]])
outReclassify = Reclassify(inRaster, "Value", remap, "NODATA")
outRasterName = '{}{}'.format(raster, outputsuffix)
outReclassify.save(env.path.join(outputDir, outRasterName)
print "outRasterName Reclassified Successfully!"
Parsing error SyntaxError: invalid syntax (line 21)
is there a better way to do this? Each raster layer only has one value which is one of the codes specified in the remap.
outReclassify.save