On Mon, Oct 11, 2010 at 7:58 PM, Vincent Davis <[email protected]>wrote:
> On Mon, Oct 11, 2010 at 6:06 PM, Ian Goodfellow > <[email protected]> wrote: > > The reasoning behind this is that == returns an array that specifies > > whether each element of the two arrays is equal. It's only defined if > > the arrays are the same shape (or maybe if they can be broadcasted to > > the same shape). > > >>> m.size==n.size > True > >>> m.shape==n.shape > True > Not sure about "be broadcasted to the same shape" > I would kind of expect == to return true, false or some error. > > Thanks > Vincent > > Maybe you are looking for numpy.allclose()? >>> n = np.array([]) >>> m = np.array([]) >>> np.allclose(n, m) True Ben Root
_______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
