On Mon, Jan 5, 2015 at 1:58 PM, Nathaniel Smith wrote:
I'm afraid that I really don't understand what you're trying to say. Is there something that you think numpy should be doing differently?

This is a case similar to the issue discussed in https://github.com/numpy/numpy/issues/5303.  Instead of getting an error (because the arguments don't create the expected 2-d matrix), a matrix with dtype object and shape (1, 3) is created.

Warren

On Mon, Jan 5, 2015 at 6:40 PM, Colin J. Williams wrote:
One of the essential characteristics of a matrix is that it be rectangular.

This is neither spelt out or checked currently.

The Doc description refers to a class:
• Returns a matrix from an array-like object, or from a string of data. A matrix is a                specialized 2-D array that retains its 2-D nature through operations. It has certain special operators, such as * (matrix multiplication) and ** (matrix power).
• This illustrates a failure, which is reported later in the calculation:

A2= np.matrix([[1, 2, -2], [-3, -1, 4], [4, 2 -6]])

Here 2 - 6 is treated as an expression.

Wikipedia offers:

In mathematics, a matrix (plural matrices) is a rectangular array[1] of numbers, symbols, or expressions, arranged in rows and columns.[2][3] The individual items in a matrix are called its elements or entries. An example of a matrix with 2 rows and 3 columns is

In the Numpy context, the symbols or expressions need to be evaluable.

Colin W.

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

--
Nathaniel J. Smith
Postdoctoral researcher - Informatics - University of Edinburgh
http://vorpus.org

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion