python - Add to Values in An Array in a CSV File -
i imported csv file , made data array. wondering, can i'm able print specific value in array? instance if wanted value in 2nd row, 2nd column. how go adding 2 values together? thanks.
import csv import numpy np f = open("test.csv") csv_f = csv.reader(f) row in csv_f: print(np.array(row)) f.close()
there no need use csv module.
this code reads csv file , prints value of cell in second row , second column. assuming fields separated commas.
with open("test.csv") fo: table = [row.split(",") row in fo.read().replace("\r", "").split("\n")] print table[1][1]
Comments
Post a Comment