Re: [Numpy-discussion] 0d array value comparisons

2008-07-25 Thread Robert Kern
On Fri, Jul 25, 2008 at 19:19, Stéfan van der Walt <[EMAIL PROTECTED]> wrote: > 2008/7/25 Thomas J. Duck <[EMAIL PROTECTED]>: >> Hi, >> >> There is some unexpected behaviour (to me) when 0-dimensional >> arrays are compared with values. For example: >> >> >>> numpy.array([0]).squeeze() == 0

Re: [Numpy-discussion] 0d array value comparisons

2008-07-25 Thread Stéfan van der Walt
2008/7/25 Thomas J. Duck <[EMAIL PROTECTED]>: > Hi, > > There is some unexpected behaviour (to me) when 0-dimensional > arrays are compared with values. For example: > > >>> numpy.array([0]).squeeze() == 0 > True > > >>> numpy.array([None]).squeeze() == None > False > > >>> numpy.array(['a

[Numpy-discussion] 0d array value comparisons

2008-07-25 Thread Thomas J. Duck
Hi, There is some unexpected behaviour (to me) when 0-dimensional arrays are compared with values. For example: >>> numpy.array([0]).squeeze() == 0 True >>> numpy.array([None]).squeeze() == None False >>> numpy.array(['a']).squeeze() == 'a' array(True, dtype=bool) Note that each t