I have data with multiple columns as 1996_1, 1997_1, etc. I need to perform IDW for each column values and save it. I am a beginner with arcpy. Please help! The code is as follows:
import arcpy, os
from arcpy import env
from arcpy.sa import *
arcpy.env.parallelProcessingFactor = "100%"
arcpy.env.overwriteOutput = True
env.workspace = "F:\Python\Arcpy"
inPointFeatures = "F:\Python\Arcpy\fluctpnt_UTM.shp"
zfield = ["1996_1","1997_1"]
for z in zfield:
outIDW_1 = Idw(inPointFeatures, zfield,0.002298707671,2,RadiusVariable(10,15000))
outIDW_1.save("004_{}.tif".format(z))
but i get this error as follows:
Runtime error
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\sa\Functions.py", line 2632, in Idw
in_barrier_polyline_features)
File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\sa\Utils.py", line 53, in swapper
result = wrapper(*args, **kwargs)
File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\sa\Functions.py", line 2624, in Wrapper
in_barrier_polyline_features)
File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\geoprocessing\_base.py", line 506, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
RuntimeError: Object: Error in executing tool
F:\Python\Arcpyluctpnt_UTM.shp
should beF:\Python\Arcpy\fluctpnt_UTM.shp
. tyr changing yourinPointFeatures
variable like so:inPointFeatures = r"F:\Python\Arcpy\fluctpnt_UTM.shp"
(I put an "r" in front of the path)