[Numpy-discussion] What is an empty matrix ?
David Cournapeau
david@ar.media.kyoto-u.ac...
Wed Jul 4 06:39:13 CDT 2007
Nils Wagner wrote:
> David Cournapeau wrote:
>> Hi,
>>
>> I was wondering what an empty matrix is, and what it is useful for
>> (by empty matrix, I mean something created by numpy.matrix([])) ? Using
>> those crash some functions (see for example scipy ticket #381), and I am
>> not sure how to fix this bug.
>>
>> David
>> _______________________________________________
>> Numpy-discussion mailing list
>> Numpy-discussion@scipy.org
>> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>>
> empty(...)
> empty((d1,...,dn),dtype=float,order='C')
>
> Return a new array of shape (d1,...,dn) and given type with all its
> entries uninitialized. This can be faster than zeros.
>
I understand numpy.empty, but this is different: an empty matrix is not
equivalent at all to empty. What I am talking about is what is the
nature of something lie numpy.array((1, 0)) ? I am actually wondering
whether it makes sense at all.
a = numpy.matrix([])
b = a + 1
does not raise any error, but I don't see how this should be considered
meaningful ?
David
More information about the Numpy-discussion
mailing list