My goal is to be able to have any excel spreadsheet (that I will save as a .cvs), and read it in python. I know how to extract the data and so far my code is this...
file = input("insert csv file name to upload: ")
with open(file) as csvfile:
readCSV = csv.reader(csvfile, delimiter = ',')
# opens any csv file if input is correct with .csv extention
x = []
y = []
for row in readCSV:
x_values = row[0]
y_values = row[1]
x.append(x_values)
y.append(y_values)
X = x[1:] # gets rid of first line(title)
Y = y[1:]
X = [float(i) for i in X]
Y = [float(i) for i in Y]
So this is fine in excel if the data is in the nice format of first row = "title" and the rest are values. But how can I filter through the whole thing and ignore any text?
I tried .isdigit(), but I ran into problems there when floats were introduced.