Python Array Multiplication using numpy
First install numpy using the below command
open command prompt then type
pip install numpy
After successful installation write the below code and run
=====================
import numpy as np # here we declare two matrices mat1 = ([1, 2, 3],[4 ,5, 6],[7, 8, 9]) mat2 = ([9, 8, 7],[6, 5, 4],[3,2, 1]) # This will return multiplication res = np.dot(mat1,mat2) # print multiplication matrix print(res)
Output will be:===============
- Get link
- X
- Other Apps
Comments
Post a Comment