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.
I was able to reproduce the issue, and the first, most simple fix is to make sure that the dissO2 attribute is correct- the reason the script was returning that same error for me was that I had named the field diss02 (with a zero instead of a capital letter O). Because the script calls dissO2, the field wasn't found.
If this doesn't solve your issue, please let me know and I'll keep working on it
inputFC = r'USA_Train'
perhaps you need to specify the whole path to the geodatabase and/or folder since there is no 'workspace' set in the script, so it probably can't find it
found your 'bug' it was in the instructions from the previous lesson
Create a training dataset—Predict Seagrass Habitats with Machine Learning | ArcGIS
Note:
It is important to save the file to your Documents folder because you'll need to use the exact file path in the Python script. If the file doesn't have the right path, the script will fail.
I have done that step and I am still receiving this error
Olivia, if it isn't that bug... tech support, so they can check with the people that wrote the module to see if there is something else at issue with it, or some other environment parameter that is causing yours to fail
Hi Olivia, I'm responsible for this tutorial at Esri. We're currently looking into this issue, and will get back to you asap with a solution. Thanks for your interest in Learn ArcGIS!
Thank you for leaping in!
Have you found any solution to this issue?
I was able to reproduce the issue, and the first, most simple fix is to make sure that the dissO2 attribute is correct- the reason the script was returning that same error for me was that I had named the field diss02 (with a zero instead of a capital letter O). Because the script calls dissO2, the field wasn't found.
If this doesn't solve your issue, please let me know and I'll keep working on it
Thank you, that solved my problem 🙂