Matrix Operations using Python

In the previous blog ,we have seen what is an array and we have seen why Numpy is used. Let us now perform some matrix operations using numpy.

Let us see arrays first. 

Remember that matrices are strictly 2 dimensional but arrays are N dimensional. Also remember that when you perform operations on numpy arrays, operations are applied element wise. We can see this below.

screenshot-35.pngWe see that a*b is array multiplication and not matrix multiplication. Array multiplication is a element wise multiplication of each element.

Let us now play with some matrices.


Check the picture below. We can see that multiplication of array is not matrix multiplication but individual element multiplication.

We can also find the transpose in the following way.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Powered by

Up ↑

%d bloggers like this: