This regards Python 2.7
I have a csv file, soq1, that looks like this in Notepad:
I used this code to read in the file and display the contents of the list soq1:
import csv
with open('D:\Users\Richard\Python\soq1.csv','rb') as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')
soq1=list(readCSV)
print(soq1)
print(type(soq1))
print(len(soq1))
I was expecting soq1 to look like: ['2','3','4','5','6']
In other words, I did not expect to have the extra set of square brackets. Did I create a list of lists?
What did I do wrong?