|
From: Piter_ <x....@gm...> - 2009-10-27 18:37:44
|
Hi all.
I have a problem with loading file of following format:
first 1024 rows are tab delimited and contain from 2 to 256 elements (in
different files different number of columns)
after that 5 empty lines
and at the end some 20 text lines for description.
I could manage to do it in this way, after commenting all text part:
a = mlab.load('/home/petro/TEMP/proba.txt',delimiter='\t',comments='%')
I was hoping to use checkrows in cvs2rec to avoid reading of the text part
of file, without commenting it.
a = mlab.csv2rec('/home/petro/TEMP/proba.txt',
checkrows=1023,delimiter='\t',names=['a','b','c','e','f','k','l','h'])
invalid literal for float(): % Date and Time:
But It failed to do so.
a = mlab.csv2rec('probe.txt',
checkrows=1023,delimiter='\t',comments='%',names=['a','b','c','e','f','k','l','h'])
This gives kind of strange format for my use and needs names to be
specified.
In addition changing of checkrows to 500 (or any other number) had no effect
on size of record I get.
loadtxt from numpy unfortunately does not have option checkrows.
Any idea how to do it without commenting.
Thanks.
Petro.
|