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

Bruce Southey bsouthey at gmail.com
Thu Oct 29 09:22:34 EDT 2009


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,
Really you have to find the reason why there are extra values in some 
rows compared to other rows. There have been some recent changes in 
numpy.genfromtxt that I would strong suggest using. It will indicate any 
problem rows that you can fix or just ignore.

Regards
Bruce





More information about the NumPy-Discussion mailing list