Expand|Select|Wrap|Line Numbers
- numpy.array(lst)
However, ideally I would like to not have to use a transition data type before converting it to a numpy array (and import the .csv file directly into a numpy array).
I have tried the
Expand|Select|Wrap|Line Numbers
- numpy.genfromtext()
My import method basically looks like this:
Expand|Select|Wrap|Line Numbers
- import csv
- f = open('fileName.csv','rb')
- rdr = csv.reader(f,delimeter=',')
- lst = []
- for row in rdr:
- lst.append(row)
Expand|Select|Wrap|Line Numbers
- numArray = numpy.array([])
- for row in rdr:
- numpy.append(numArray,row)
I have also tried
Expand|Select|Wrap|Line Numbers
- numpy.row_stack
Expand|Select|Wrap|Line Numbers
- csv.reader()
Any ideas / assistance you could provide would be most greatly appreciated.!!!