I have a CSV file in the same directory as my Python script, and I would like to take that data and turn it into a list that I can use later. I would prefer to use Python's CSV module. After reading the the module's documentation and questions regarding it, I have still not found any help.
Code
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
inputfile = 'inputfile.csv'
inputm = []
reader = csv.reader(inputfile)
for row in reader:
inputm.append(row)
inputfile.csv
point1,point2,point3,point4
0,1,4,1
0,1,1,1
0,1,4,1
0,1,0,0
0,1,2,1
0,0,0,0
0,0,0,0
0,1,3,1
0,1,4,1
It only returns the string of the filename I provide it.
[['i'], ['n'], ['p'], ['u'], ['t'], ['f'], ['i'], ['l'], ['e']]
I would like it to return each row of the CSV file as a sub-list instead of each letter of the filename as a sub-list.