[Numpy-discussion] equality of empty arrays
Mon Oct 11 19:06:08 CDT 2010
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).
The correct way to check if an array is empty is to inspect its .shape
On Oct 11, 2010, at 8:03 PM, Vincent Davis wrote:
> I assume there is some reasoning behind this
>>>> m = np.array()
>>>> n = np.array()
> array(, dtype=bool)
> I was expecting somthing like.
>>>> m = 
>>>> n = 
> What is the right way to test if an array is empty?
> Vincent Davis
> NumPy-Discussion mailing list
More information about the NumPy-Discussion