On Tue, May 6, 2008 at 9:31 AM, Andy Cheesman <[EMAIL PROTECTED]>
wrote:

> Hi nice numpy people
>
> I was wondering if anyone could shed some light on how to distinguish an
> empty array of a given shape and an zeros array of the same dimensions.


An empty array is just uninitialized, while a zeros array is initialized to
zeros. Short of checking whether the zeros array is all zeros, which only
tells you that it looks like it was coming from zeros; it still could have
created by by empty or zeros or some other method.

Why do you need to know? If the array is coming from an unknown source, why
not just use a.fill(0) to force everything to be zero and start from a known
state?




>
>
> Thanks
> Andy
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>



-- 
. __
. |-\
.
. [EMAIL PROTECTED]
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to