Change language

numpy.asmatrix () in Python

|

numpy.asmatrix (data, dtype = None) Returns a matrix, 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 Illustrative
# numpy.asmatrix

 

import numpy as geek

 
# massive input

b = geek.matrix ([[ 5 , 6 , 7 ], [ 4 , 6 ]])

print ( "Via array-like input:" , b, "" )

  

c = geek.asmatrix ( b)

b [ 0 , 1 ] = 10

print ( "c matrix: " , c)

Output:

 Via array-like input: [[[5, 6, 7] [4, 6]]] c matrix: [[[5, 6, 7] 10]] 

Note: these NumPy-Python programs won’t work by onlineID, so run them on your systems to learn them
,
This article is provided by Mohit Gupta_OMG

Shop

Learn programming in R: courses

$

Best Python online courses for 2022

$

Best laptop for Fortnite

$

Best laptop for Excel

$

Best laptop for Solidworks

$

Best laptop for Roblox

$

Best computer for crypto mining

$

Best laptop for Sims 4

$

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers


Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method