matrix - Implicit Matrices in Python -


i have matrices in multiplication , 2x2, 2x1 , 2x1.

[ b        [ e(a1)          [ a1   c d ]  x     f(a2) ]    =     a2 ]  

how can calculate a1 , a2 in python ? think use implicit methods how ?

i think need use numpy.

installing numpy in linux such easy as:

 $ pip install numpy collecting numpy   downloading numpy-1.11.2-cp27-cp27mu-manylinux1_x86_64.whl (15.3mb)     100% |████████████████████████████████| 15.3mb 92kb/s installing collected packages: numpy installed numpy-1.11.2 

do root if not in virtualenv.

there example of matrices multiplication in interactive python session below:

>>> import numpy np >>> = [[1, 0], [0, 1]] >>> b = [[4, 1], [2, 2]] >>> np.matmul(a, b) array([[4, 1],        [2, 2]]) 

numpy best choice if have play mathematics.


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -