I am working on the Predict Seagrass habitats with machine learning module by esri, I am working in ArcPro, when I am coding in python to bring the ArcGIS feature classes in python as an array its gives me this error.
from sklearn.ensemble import RandomForestClassifier
import numpy as NUM
import arcpy as ARCPY
import arcpy.da as DA
import pandas as PD
import seaborn as SEA
import matplotlib.pyplot as PLOT
import arcgisscripting as ARC
import SSUtilities as UTILS
import os as OS
inputFC = r'USA_Train'
globalFC = r'EMU_Global_90m_Filled'
predictVars = ['DISSO2', 'NITRATE', 'PHOSPHATE', 'SALINITY', 'SILICATE', 'SRTM30', 'TEMP']
classVar = ['PRESENT']
allVars = predictVars + classVar
trainFC = DA.FeatureClassToNumPyArray(inputFC, ["SHAPE@XY"] + allVars)
spatRef = ARCPY.Describe(inputFC).spatialReference
Traceback (most recent call last):
File "<string>", line 1, in <module>
RuntimeError: The table was not found. [VAT_temp]
trainFC = ARCPY.da.FeatureClassToNumPyArray(inputFC, ["SHAPE@XY"] + allVars)
Traceback (most recent call last):
File "<string>", line 1, in <module>
RuntimeError: The table was not found. [VAT_temp]
Solved! Go to Solution.
Hi Cappelli,
Thank you for your information. I had the same problem when doing the same task in Learn GIS: lesson for data scientists, which is: when runing the code
trainFC = DA.FeatureClassToNumPyArray(inputFC, ["SHAPE@XY"] + allVars)
it shows
Traceback (most recent call last):
File "<string>", line 1, in <module>
RuntimeError: The table was not found. [VAT_temp]
I checked my spell of the names of attributes in USA_train layer to make sure that I didn't confuse letter O and number 0 (yes, it is letter O):
Could you please help me with that? (And is there other information that I need to provide for solving the problem?)
Thank you.
predictVars = ['DISSO2', 'NITRATE', 'PHOSPHATE', 'SALINITY', 'SILICATE', 'SRTM30', 'TEMP']
classVar = ['PRESENT']
This is the tutorial script, if you are copy+pasting, your table reads "Presentation" instead of "Present". Possibly the problem if you didn't change the script.
Just came here for similar problem and realized it was an O/0 problem as well, thanks to all who helped.