Hi,

On Sep 9, 2011, at 17:05 , Renan Birck Pinheiro wrote:

> I have the following Sage code (it comes from a larger Python program):
> 
> from scipy.stats import norm, randint
> 
> signalD = randint(0,2);
> signal = signalD.rvs(10);
> 
> It successfully generates the array "signal" with 10 random elements.
> 
> However, this fails:
> 
> list_plot(signal)
>        Traceback (click to the left of this block for traceback)
>        ...
>        ValueError: The truth value of an array with more than one element
> is ambiguous. Use a.any() or a.all()

I *think* that the problem is the type of 'signal': it's a "numpy.ndarray".  
Evidently, such a gizmo can be coerced to a list or tuple, but not a dictionary.

Your "work-around" (or "list(signal)") should make it work, as you've noticed.

I don't know whether this can be called a bug, or that other thing.  Anyone 
have a thought?

HTH

Justin

--
Justin C. Walker, Curmudgeon at Large
Institute for the Absorption of Federal Funds
--
Democracy is two wolves and a lamb
   voting on what to have for lunch.
Liberty is a well-armed lamb contesting
   the vote.



-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to