Python | Numpy numpy.matrix.A() (original) (raw)
Last Updated : 08 Apr, 2019
With the help of **Numpy numpy.matrix.A()**
method, we can get the same matrix as self. It means through this method we can get the identical matrix.
Syntax :
numpy.matrix.A()
Return : Return self matrix
Example #1 :
In this example we can see that with the help of matrix.A()
method, we are able to get the self matrix.
import
numpy as np
gfg
=
np.matrix(
'[1, 2, 3, 4]'
)
geeks
=
gfg.getA()
print
(geeks)
Example #2 :
import
numpy as np
gfg
=
np.matrix(
'[1, 2, 3; 4, 5, 6; 7, 8, 9]'
)
geeks
=
gfg.getA()
print
(geeks)
Output:
[[1 2 3] [4 5 6] [7 8 9]]
Similar Reads
- Python | Numpy numpy.matrix.T() With the help of Numpy numpy.matrix.T() method, we can make a Transpose of any matrix either having dimension one or more than more. Syntax : numpy.matrix.T() Return : Return transpose of every matrix Example #1 : In this example we can see that with the help of matrix.T() method, we are able to tra 1 min read
- numpy.asmatrix() in Python numpy.asmatrix(data, dtype = None) Returns a matrix by interpreting the input as a matrix. Parameters : data : array-like input data dtype : Data type of returned array Returns : Interprets the input as a matrix # Python Programming illustrating # numpy.asmatrix import numpy as geek # array-like inp 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
- Python | Numpy numpy.ndarray.__add__() With the help of Numpy numpy.ndarray.__add__(), we can add a particular value that is provided as a parameter in the ndarray.__add__() method. Value will be added to each and every element in a numpy array. Syntax: ndarray.__add__($self, value, /) Return: self+value Example #1 : In this example we c 1 min read
- numpy.amax() in Python The numpy.amax() method returns the maximum of an array or maximum along the axis(if mentioned). Syntax: numpy.amax(arr, axis = None, out = None, keepdims = <class numpy._globals._NoValue>) Parameters - arr : [array_like] input dataaxis : [int or tuples of int] axis along which we want the max 2 min read
- Python | Numpy numpy.ndarray.__iadd__() With the help of numpy.ndarray.__iadd__() method, we can add a particular value that is provided as a parameter in the ndarray.__iadd__() method. Value will be added to every element in a numpy array. Syntax: ndarray.__iadd__($self, value, /) Return: self+=value Example #1 : In this example we can s 1 min read
- numpy.argmax() in Python The numpy.argmax() function returns indices of the max element of the array in a particular axis. Syntax : numpy.argmax(array, axis = None, out = None) Parameters : array : Input array to work on axis : [int, optional]Along a specified axis like 0 or 1 out : [array optional]Provides a feature to ins 3 min read
- numpy.bmat() in Python numpy.bmat(obj, l_dict = None, g_dict = None) : Return specialised 2-D matrix from nested objects that can be string-like or array-like. Parameters : object : array-like or string l_dict : (dict, optional) replaces local operands, A dictionary that replaces local operands in current frame g_dict : ( 2 min read
- Python | Numpy numpy.ndarray.__mod__() With the help of Numpy numpy.ndarray.__mod__(), every element in an array is operated on binary operator i.e mod(%). Remember we can use any type of values in an array and value for mod is applied as the parameter in ndarray.__mod__(). Syntax: ndarray.__mod__($self, value, /) Return: self%value Exam 1 min read
- numpy.amin() in Python The numpy.amin() function returns minimum of an array or minimum along axis(if mentioned). Syntax : numpy.amin(arr, axis = None, out = None, keepdims = <class numpy._globals._NoValue>) Parameters : arr : [array_like]input dataaxis : [int or tuples of int]axis along which we want the min value. 2 min read