Hi,

On Mon, Jan 5, 2015 at 8:40 PM, Colin J. Williams <cjwilliams43@gmail.com> wrote:

The Doc description refers to a class:One of the essential characteristics of a matrix is that it be rectangular.This is neither spelt out or checked currently.

classnumpy.matrix[source]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.

FWIW, here A2 is definitely rectangular, with shape== (1, 3) and dtype== object, i.e elements are just python lists.

Wikipedia offers:

In mathematics, a

matrix(pluralmatrices) is a rectangulararray^{[1]}of numbers, symbols, or expressions, arranged inrowsandcolumns.^{[2]}^{[3]}

(and in this context also python objects).

-eat

The individual items in a matrix are called its

elementsorentries. 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