I am doing a machine learning project in materials science, this code asks me to choose files to upload, but when I name the files it comes up with an error message. The beginning of the code (and relevant bits) are included below:
import xlrd
import re
import numpy
from sklearn import svm
from sklearn import preprocessing
from sklearn import tree
from sklearn.ensemble import RandomForestClassifier
import random
import os
from xlutils.copy import copy
import xlsxwriter
import graphviz
def main():
pastExperiments = StoredData()
response = input('Do you wish to use continuous representation of discreet data if available data? y or n\t')
if response == 'y':
pastExperiments.useContinuousRepresentation = True
else:
pastExperiments.useContinuousRepresentation = False
response = input('Do you want to choose import data? y or n\t')
if response == 'y':
while response == 'y':
nameOfFile = input('What is the name of the file you wish to import.\t')
pastExperiments.importFile('./Input/' + nameOfFile)
response = input('Do you wish to import additional data? y or n\t')
#At this point all training data should have been imported.
else:
folder = os.fsencode('Input')
for inputFile in os.listdir(folder):
fileName = os.fsdecode(inputFile)
if fileName.endswith(".xlsx"):
pastExperiments.importFile('./Input/' + fileName)
else:
continue
Here is the error message I get:
FileNotFoundError: [Errno 2] No such file or directory: './Input/Sample_info_.xlsx'
Thanks!