I have a feature matrix in cvs file. I need to read it into python and name it “homevalue”. What is the code for this?
Expert Answer
Don't use plagiarized sources. Get Your Custom Essay on
Question & Answer: I have a feature matrix in cvs file. I need to read it into python and name it "homeval…..
GET AN ESSAY WRITTEN FOR YOU FROM AS LOW AS $13/PAGE
#importing csv
import csv
#opening csv file called matrix into file
file = open(‘matrix.csv’,’r’)
#reader will store with delimiter as space
reader = csv.reader(file,delimiter=’ ‘)
#homevalue is a list to store matrix values
homevalue = []
#for every row in reader
for row in reader:
#append it to list called homevalue
homevalue.append(row)
#printing the homevalue data
for i in homevalue:
print i