numpy.matrix.A() function Python (original) (raw)
Last Updated : 18 Jun, 2020
numpy.matrix.A()
function return self as an ndarray object.
Syntax : numpy.matrix.A()
Parameters : None
Return : [ndarray] Return self as an ndarray.
Code #1 :
import
numpy as geek
mat
=
geek.matrix(geek.arange(
9
).reshape((
3
,
3
)))
gfg
=
mat.getA()
print
(gfg)
Output :
[[0 1 2] [3 4 5] [6 7 8]]
Code #2 :
import
numpy as geek
mat
=
geek.matrix(geek.arange(
20
).reshape((
4
,
5
)))
gfg
=
mat.getA()
print
(gfg)
Output :
[[ 0 1 2 3 4] [ 5 6 7 8 9] [10 11 12 13 14] [15 16 17 18 19]]
Similar Reads
- Numpy matrix.I function | Python With the help ofnumpy.matrix.I() function we can get the multiplicative inverse of the same size as of our given matrix. Syntax : numpy.matrix.I() Return : [matrix object] If self is non-singular, ret is such that ret * self == self * ret == np.matrix(np.eye(self[0, :].size) all return True. Return 1 min read
- numpy.matrix() in Python This class returns a matrix from a string of data or array-like object. Matrix obtained is a specialised 2D array. Syntax : numpy.matrix(data, dtype = None) : Parameters : data : data needs to be array-like or string dtype : Data type of returned array. Returns : data interpreted as a matrix # Pytho 1 min read
- numpy.i0() function | Python numpy.i0() function is the modified Bessel function of the first kind, order 0. it's usually denoted by I0. Syntax : numpy.i0(x) Parameters : x : [array_like, dtype float or complex] Argument of the Bessel function. Return : [ndarray, shape = x.shape, dtype = x.dtype] The modified Bessel function ev 1 min read
- numpy.matlib.empty() function | Python numpy.matlib.empty() function return a new matrix of given shape and type, without initializing entries. Syntax : numpy.matlib.empty(shape, dtype = None, order = 'C') Parameters : shape : [int or tuple of int] Shape of the empty matrix. dtype : [data-type, optional] Desired output data-type. order : 1 min read
- numpy.moveaxis() function | Python numpy.moveaxis() function allows you to rearrange axes of an array. It is used when you need to shift dimensions of an array to different positions without altering the actual data. The syntax for the numpy.moveaxis() function is as follows: numpy.moveaxis(array, source, destination) Parameters: arr 2 min read
- numpy.nanstd() function - Python numpy.nanstd() function compute the standard deviation along the specified axis, while ignoring NaNs. Syntax : numpy.nanstd(arr, axis = None, dtype = None, out = None, ddof = 0, keepdims) Parameters : arr : [array_like] Calculate the standard deviation of the non-NaN values. axis : [{int, tuple of i 2 min read
- numpy matrix operations | eye() function numpy.matlib.eye() is another function for doing matrix operations in numpy. It returns a matrix with ones on the diagonal and zeros elsewhere. Syntax : numpy.matlib.eye(n, M=None, k=0, dtype='float', order='C') Parameters : n : [int] Number of rows in the output matrix. M : [int, optional] Number o 2 min read
- numpy.ma.filled() function - Python numpy.ma.filled() function return input as an array with masked data replaced by a fill value. If arr is not a MaskedArray, arr itself is returned. If arr is a MaskedArray and fill_value is None, fill_value is set to arr.fill_value. Syntax : numpy.ma.filled(arr, fill_value = None) Parameters : arr : 1 min read
- numpy.matlib.zeros() function | Python numpy.matlib.zeros() function return matrix of given shape and type, filled with zeros. Syntax : numpy.matlib.zeros(shape, dtype = None, order = 'C') Parameters : shape : [sequence of ints] Shape of the empty matrix. dtype : [data-type, optional] The desired data-type for the matrix, default is floa 1 min read
- Python | numpy.cov() function Covariance provides the measure of strength of correlation between two variable or more set of variables. The covariance matrix element Cij is the covariance of xi and xj. The element Cii is the variance of xi. If COV(xi, xj) = 0 then variables are uncorrelatedIf COV(xi, xj) > 0 then variables po 2 min read