I am trying to import csv file to Python. I have two question here.
Q1. my code is:
import csv
with open('highfrequency2.csv') as csvfile:
freq=csv.reader(csvfile, delimiter=',')
for row in freq:
print(row[1],row[8])
But there is an error message here
IndexError: list index out of range
Q2. my data output looks like
['WOSl.TQ', '02-Jan-14', '51:48.0', 'Quote', '', '']
['WOSl.TQ', '02-Jan-14', '51:48.0', 'Quote', '', '']
['WOSl.TQ', '02-Jan-14', '51:48.0', 'Quote', '', '']
['WOSl.TQ', '02-Jan-14', '51:48.0', 'Quote', '', '']
['WOSl.TQ', '02-Jan-14', '51:48.0', 'Quote', '', '']
.....
....
Do I have to use 'r' or 'rb' function in reading the file ?
I want to see the 2nd and the 8th row of the CSV file.