Hi, my friends,
I try to use csv module to input data in csv format but split does not work. Could you please help? The input data is 2 column data separated in comma as csv format.
The code is following:
reader = csv.reader(open('Indices.csv', 'r'), delimiter = ',')
line = 0
IndexHeader = reader.next()
line = line+1
for line in reader:
print line
TradingDate, MarketIndex = line.split(',')
The error is after running these code:
AttributeError: 'list' object has no attribute 'split'
The data is very simple like:
Date, Num
04/04/2006,1305.93000000
04/05/2006,1311.56000000
04/06/2006,1309.04000000
04/07/2006,1295.50000000
04/10/2006,1296.60000000
04/11/2006,1286.57000000
Thanks so much in advance.
John