Flipud m

Return the array, m, with columns preserved and rows reversed in the up-down direction. For m.ndim > 1, this works on the first dimension (equivalent to m[::-1])

Rotate the first two dimensions of an array, m, by k*90 degrees in the counterclockwise direction. Must have m.ndim >=2.

Construct an N x M array where all the diagonals starting from the lower left corner up to the kth diagonal are all ones.

Return a upper-triangular 2-d array from m with all the elements below the kth diagonal set to 0.

Return a lower-triangular 2-d array from m with all the elements above the kth diagonal set to 0.

mat (data, dtype=None)

Construct a matrix from data. Alias for numpy.asmatrix. The calling syntax is the same as that function. Note that data can be a string in which case the routine uses spaces and semi-colons to construct the matrix:

>>> mat('1 3 4; 5 6 9') matrix([[1, 3, 4], [5, 6, 9]])

bmat (obj, ldict=None, gdict=None)

Build a matrix from sub-blocks. This is similar to mat, except the items in the nested-sequence, or string, should be appropriately shaped 2-d arrays. If obj is a string, then ldict and gdict can be used to alter where the names represented in the string are found (default is current local and global namespace).

>>> A=mat('1 2;


4') ; B=mat('5 6 ; 7 8')

>>> bmat('A, B;


A' )

matrix([[1, 2,


6] ,

[3, 4, 7, 8],

[5, 6, 1, 2],

[7, 8, 3, 4]] )

Was this article helpful?

0 0

Post a comment