where is the error?

Gary Herron gherron at islandtraining.com
Thu Jun 26 17:27:08 CEST 2008


lajam at caramail.com wrote:
> Hello,
>
> I'm trying to assign data into an array with the nonzero function.
> There is my code.
>
> from numarray import *
> diff_temp=(logical_and(values[:,5] > -2,values[:,5] < 2)).nonzero()
>   

Does that have something to do with the question below?

> This command works fine but when I apply the following,
>
> values_matchup=values_Stumpf[diff_temp_Stumpf,:]
>   

Clearly, from the error message, the index  diff_temp_Stumpf is not one 
of the allowed types.   Have you examined its value?   Printed it?   Set 
it equal to a known legal value and tried that line again?

First thing:  Find out what value that index has, then if it's necessary 
to ask your question again, include that information and we'll have 
something to go on in forming an answer.

Gary Herron

> I have this error message:
> IndexError: each subindex must be either a slice, an integer,
> Ellipsis, or NewAxis
>
> Does someone know what it is the problem? I'm using python2.4.3 on
> Ubuntu.
>
> Using this command with python on windows xp worked fine.
>
> Thank you for the help,
> Cedric
> --
> http://mail.python.org/mailman/listinfo/python-list
>   




More information about the Python-list mailing list