arrays - Excel CSV help Python -
i have following csv file:
how import numbers array in python 1 row @ time? no date, no string.
my code:
import csv def test(): out = open("example.csv","rb") data = csv.reader(out) data = [row row in data] out.close() print data
let me more clear. don't want huge 2d array. want import 2nd row , manipulate data 3rd row. need loop this, not sure on how csv works.
try this:
with open('the_csv_file.csv','r') f: box = f.readlines() result_box = [] line in box[1:]: items = line.split(';') # adjust separator character in csv needed result_box.append(items[1:]) print result_box
Comments
Post a Comment