[SciPy-user] empty()
Robin
robince at gmail.com
Thu Mar 6 14:01:49 EST 2008
On Thu, Mar 6, 2008 at 6:51 PM, Dinesh B Vadhia
<dineshbvadhia at hotmail.com> wrote:
> I have to ask but in
> > A= scipy.asmatrix(scipy.empty((I, J), int))
>
> does the empty() function really 'empty' out the array or does it just
> allocate space for the array leaving spurious content in the array?
It just allocates space, leaving spurious content in the array. This
is OK if you are later going to assign each element. If you want the
entries initialised you can use zeros() or ones().
>From the docstring:
"""
Return a new array of shape (d1,...,dn) and given type with all its
entries uninitialized. This can be faster than zeros.
"""
Robin
More information about the SciPy-User
mailing list