<jupyter_start><jupyter_text>numpy.matrix class numpy.matrix(data, dtype=None, copy=True)<jupyter_code>import numpy as np
a = np.matrix('1 2; 3 4')
print(a)
np.matrix([[1, 2], [3, 4]])
a.T
a.transpose()
b = np.matrix([[3,4],[4,5]])
b
a+b
a-b
a*b
a**2
a/b
a//b
a%b
a==b
a!=b
a<b
a>b
a<=b
a>=b
np.min(a)
np.max(a)
np.lexsort(a)
a.I
a.T
a.A1
a.base
a.data
a.dtype
a.flags
x = np.matrix(np.arange(12).reshape((3,4)))
x
x.prod()
x.prod(0)
a = np.eye(2)
b = np.ones((2, 2)) * 2
a.dot(b)
a = np.arange(16).reshape(4,4)
a
a.diagonal()
a.diagonal(1)

a.diagonal(3)<jupyter_output><empty_output><jupyter_text>Attributes:	AReturn self as an ndarray object.A1Return self as a flattened ndarray.HReturns the (complex) conjugate transpose of self.IReturns the (multiplicative) inverse of invertible self.TReturns the transpose of the matrix.baseBase object if memory is from some other object.ctypesAn object to simplify the interaction of the array with the ctypes module.dataPython buffer object pointing to the start of the array’s data.dtypeData-type of the array’s elements.flagsInformation about the memory layout of the array.flatA 1-D iterator over the array.imagThe imaginary part of the array.itemsizeLength of one array element in bytes.nbytesTotal bytes consumed by the elements of the array.ndimNumber of array dimensions.realThe real part of the array.shapeTuple of array dimensions.sizeNumber of elements in the array.stridesTuple of bytes to step in each dimension when traversing an array.<jupyter_code># Methods

all([axis, out])	Test whether all matrix elements along a given axis evaluate to True.
any([axis, out])	Test whether any array element along a given axis evaluates to True.
argmax([axis, out])	Indexes of the maximum values along an axis.
argmin([axis, out])	Indexes of the minimum values along an axis.
argpartition(kth[, axis, kind, order])	Returns the indices that would partition this array.
argsort([axis, kind, order])	Returns the indices that would sort this array.
astype(dtype[, order, casting, subok, copy])	Copy of the array, cast to a specified type.
byteswap([inplace])	Swap the bytes of the array elements
choose(choices[, out, mode])	Use an index array to construct a new array from a set of choices.
clip([min, max, out])	Return an array whose values are limited to [min, max].
compress(condition[, axis, out])	Return selected slices of this array along given axis.
conj()	Complex-conjugate all elements.
conjugate()	Return the complex conjugate, element-wise.
copy([order])	Return a copy of the array.
cumprod([axis, dtype, out])	Return the cumulative product of the elements along the given axis.
cumsum([axis, dtype, out])	Return the cumulative sum of the elements along the given axis.
diagonal([offset, axis1, axis2])	Return specified diagonals.
dot(b[, out])	Dot product of two arrays.
dump(file)	Dump a pickle of the array to the specified file.
dumps()	Returns the pickle of the array as a string.
fill(value)	Fill the array with a scalar value.
flatten([order])	Return a flattened copy of the matrix.
getA()	Return self as an ndarray object.
getA1()	Return self as a flattened ndarray.
getH()	Returns the (complex) conjugate transpose of self.
getI()	Returns the (multiplicative) inverse of invertible self.
getT()	Returns the transpose of the matrix.
getfield(dtype[, offset])	Returns a field of the given array as a certain type.
item(*args)	Copy an element of an array to a standard Python scalar and return it.
itemset(*args)	Insert scalar into an array (scalar is cast to array’s dtype, if possible)
max([axis, out])	Return the maximum value along an axis.
mean([axis, dtype, out])	Returns the average of the matrix elements along the given axis.
min([axis, out])	Return the minimum value along an axis.
newbyteorder([new_order])	Return the array with the same data viewed with a different byte order.
nonzero()	Return the indices of the elements that are non-zero.
partition(kth[, axis, kind, order])	Rearranges the elements in the array in such a way that the value of the element in kth position is in the position it would be in a sorted array.
prod([axis, dtype, out])	Return the product of the array elements over the given axis.
ptp([axis, out])	Peak-to-peak (maximum - minimum) value along the given axis.
put(indices, values[, mode])	Set a.flat[n] = values[n] for all n in indices.
ravel([order])	Return a flattened matrix.
repeat(repeats[, axis])	Repeat elements of an array.
reshape(shape[, order])	Returns an array containing the same data with a new shape.
resize(new_shape[, refcheck])	Change shape and size of array in-place.
round([decimals, out])	Return a with each element rounded to the given number of decimals.
searchsorted(v[, side, sorter])	Find indices where elements of v should be inserted in a to maintain order.
setfield(val, dtype[, offset])	Put a value into a specified place in a field defined by a data-type.
setflags([write, align, uic])	Set array flags WRITEABLE, ALIGNED, (WRITEBACKIFCOPY and UPDATEIFCOPY), respectively.
sort([axis, kind, order])	Sort an array, in-place.
squeeze([axis])	Return a possibly reshaped matrix.
std([axis, dtype, out, ddof])	Return the standard deviation of the array elements along the given axis.
sum([axis, dtype, out])	Returns the sum of the matrix elements, along the given axis.
swapaxes(axis1, axis2)	Return a view of the array with axis1 and axis2 interchanged.
take(indices[, axis, out, mode])	Return an array formed from the elements of a at the given indices.
tobytes([order])	Construct Python bytes containing the raw data bytes in the array.
tofile(fid[, sep, format])	Write array to a file as text or binary (default).
tolist()	Return the matrix as a (possibly nested) list.
tostring([order])	Construct Python bytes containing the raw data bytes in the array.
trace([offset, axis1, axis2, dtype, out])	Return the sum along diagonals of the array.
transpose(*axes)	Returns a view of the array with axes transposed.
var([axis, dtype, out, ddof])	Returns the variance of the matrix elements, along the given axis.
view([dtype, type])	New view of array with the same data.<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09229010127409343, 'fraction_numerical': 0.006533812479581836, 'mean_word_length': 5.032512315270936, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '40154', 'license': 'MIT', 'n_tokens_mistral': 1902, 'n_tokens_neox': 1827, 'n_words': 880, 'path': '11. Matrix .ipynb', 'repo_name': 'mohansurya1729/numpy', 'size': '6122'}