[Numpy-discussion] Tests for empty arrays
Tue May 6 11:43:13 CDT 2008
On Tue, May 6, 2008 at 9:31 AM, Andy Cheesman <Andy.firstname.lastname@example.org>
> 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
> Numpy-discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion