[Numpy-discussion] What is an empty matrix ?
openopt at ukr.net
Wed Jul 4 08:21:00 EDT 2007
As for me, I used empty matrices in MATLAB as well as python rather often.
from numpy import array, hstack
m = A.shape
a = array(()).reshape(0,m)
for i in some_ind:
a = hstack((a, A[i]))
for i in some_ind2:
a = hstack((a, Aeq[i]))
from numpy import append
def myfunc(arr, arr2 = numpy.array(()))
assert(arr.ndim==1 and arr2.ndim==1)
return append(arr, arr2, 1)
David Cournapeau wrote:
> 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.
> Numpy-discussion mailing list
> Numpy-discussion at scipy.org
More information about the NumPy-Discussion