I am trying to create a Python array using data from an ArcGIS attribute table. Here's the code I've written so far:
import arcpy
import numpy
input = "c:/data/from/arcgis"
arr = arcpy.da.TabletoNumPyArray(input,('OBJECTID','SoilEvap5'))
a = arr["OBJECTID"]
b = arr["SoilEvap5"]
np.columnstack((a,b))
print arr
When I try running this in the ArcGIS Python window, it returns:
Runtime error
Traceback (most recent call last):
File "<string>", line 7, in <module>
AttributeError: 'module' object has no attribute 'TabletoNumPyArray'
Why is this error showing up and how can I fix it?
import arcpy
and run your code once first. Also, to force it to auto complete usingCtrl-spacebar
is a trick worth knowing. – PolyGeo♦ Jul 20 at 22:55