Hi,
I am trying to load a tsv file using numpy.loadtxt:
data = np.loadtxt('data.txt',delimiter='\t',dtype=np.float)
And I get:
-
/usr/lib/python2.6/site-packages/numpy/lib/io.pyc in loadtxt(fname, dtype,
comments, delimiter, converters, skiprows, usecols, unpack)
503
Have you tried the numpy.fromfile function? This usually worked great for
my files that had the same format than yours.
++
Peter
--
PhD Student at the Molecular Modeling and Bioinformatics Group
Dep. Physical Chemistry
Faculty of Pharmacy
University of Barcelona
Adter trying the same thing in matlab, I realized that my tsv file is not
matrix-style. But this I mean, not all lines ave the same lenght (not the
same number of values).
What would be the best way to load this?
Regards,
Nathan
--
View this message in context:
On Thu, 29 Oct 2009 05:30:09 -0700 (PDT), TheLonelyStar
nabb...@lonely-star.org wrote:
Adter trying the same thing in matlab, I realized that my tsv file is
not
matrix-style. But this I mean, not all lines ave the same lenght (not the
same number of values).
What would be the best way to
On 10/29/2009 07:30 AM, TheLonelyStar wrote:
Adter trying the same thing in matlab, I realized that my tsv file is not
matrix-style. But this I mean, not all lines ave the same lenght (not the
same number of values).
What would be the best way to load this?
Regards,
Nathan
Hi,
Peter Schmidtke wrote:
Have you tried the numpy.fromfile function?
good point -- fromfile() can be much faster for the simple cases it can
handle.
not all lines ave the same lenght (not the
same number of values).
What would be the best way to load this?
That depends on what the data
On Oct 29, 2009, at 8:30 AM, TheLonelyStar wrote:
Adter trying the same thing in matlab, I realized that my tsv file
is not
matrix-style. But this I mean, not all lines ave the same lenght
(not the
same number of values).
What would be the best way to load this?
The SVN version of