[Numpy-discussion] numpy loadtxt - ValueError: setting an array element with a sequence.

2009-10-29 Thread TheLonelyStar
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

[Numpy-discussion] numpy loadtxt - ValueError: setting an array element with a sequence.

2009-10-29 Thread Peter Schmidtke
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

Re: [Numpy-discussion] numpy loadtxt - ValueError: setting an array element with a sequence.

2009-10-29 Thread TheLonelyStar
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:

Re: [Numpy-discussion] numpy loadtxt - ValueError: setting an array element with a sequence.

2009-10-29 Thread Peter Schmidtke
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

Re: [Numpy-discussion] numpy loadtxt - ValueError: setting an array element with a sequence.

2009-10-29 Thread Bruce Southey
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,

Re: [Numpy-discussion] numpy loadtxt - ValueError: setting an array element with a sequence.

2009-10-29 Thread Christopher Barker
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

Re: [Numpy-discussion] numpy loadtxt - ValueError: setting an array element with a sequence.

2009-10-29 Thread Pierre GM
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