[SciPy-user] where bug

Ryan Krauss ryanlists at gmail.com
Tue Oct 10 01:26:50 CDT 2006


I am having a problem running some slightly older code under a fairly
new Scipy for the first time.  The code uses where and something like
this:
In [23]: t=arange(0,1,0.01)

In [24]: where(t>0.5)
Out[24]:
(array([51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
       68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
       85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99]),)

used to return just the array instead of the tuple with the array in
it.  Is this a feature or a bug?  Can you get this behavior from a
stray comma in the return line?

Thanks,

Ryan


More information about the SciPy-user mailing list