Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

append in dictionary with matrix values

import numpy as np

a = np.mat('4 3; 2 1')
b = np.mat('1 2; 3 4')
print(a)
# [[4 3]
#  [2 1]]
print(b)
# [[1 2]
#  [3 4]]
print(a*b)
# [[13 20]
#  [ 5  8]]
Comment

append in dictionary with matrix values

import numpy as np

a = np.array([[4, 3], [2, 1]])
b = np.array([[1, 2], [3, 4]])
print(a@b)
# [[13 20]
#  [ 5  8]]
Comment

append in dictionary with matrix values

c = np.array([[4, 3], [2, 1]])
d = np.array([[1, 2], [3, 4]])
print(c*d)
# [[4 6]
#  [6 4]]
Comment

append in dictionary with matrix values

print(np.dot(c,d))
# [[13 20]
#  [ 5  8]]
Comment

append in dictionary with matrix values

print(a**2)
# [[22 15]
#  [10  7]]
print(c**2)
# [[16  9]
#  [ 4  1]]
Comment

PREVIOUS NEXT
Code Example
Python :: python forward and bachward seperators 
Python :: Collecting pipnev 
Python :: free function in python 
Python :: dict to csv keys as rows and subkey as columns in python 
Python :: mhaan meaning in english 
Python :: how to use wbtools in python 
Python :: readme python convert to pdf 
Python :: comment arrĂȘter un jeu en appuyant sur une touche python 
Python :: treat NaN as a category 
Python :: python dijkstra implementation stack 
Python :: converting 4hr 20min to minutes 
Python :: docker python heelo world doesnt print anything 
Python :: matplotlib plt.sapect 
Python :: jupyter_ascending 
Python :: inspect first 5 rows of dataframe 
Python :: creation 2eme fenetre tkinter 
Python :: python fibonacci sequence while loop 
Python :: pandas continues update csv with exception 
Python :: set_flip_h( false ) 
Python :: flask request file upload to dropbox 
Python :: Python docx title 
Python :: how to make a series in python alternating between + and - 
Python :: pseudo-random input signal python 
Python :: download python for windows 7 32-bit 
Python :: 4.3.3. Reassigning Variables 
Python :: Return monthly sales value in Django 
Python :: clear terminal anaconda 
Python :: xgb plot importance round 
Python :: auto reload exml odoo 13 
Python :: tuple with mixed data types 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =