``````

In [1]:

import numpy as np

``````
``````

In [2]:

v = np.array([0, 1, 2])
print(v)

``````
``````

[0 1 2]

``````
``````

In [3]:

print(v.shape)

``````
``````

(3,)

``````
``````

In [4]:

print(np.inner(v, v))

``````
``````

5

``````
``````

In [5]:

print(type(np.inner(v, v)))

``````
``````

<class 'numpy.int64'>

``````
``````

In [6]:

print(np.dot(v, v))

``````
``````

5

``````
``````

In [7]:

print(np.matmul(v, v))

``````
``````

5

``````
``````

In [8]:

print(v @ v)

``````
``````

5

``````
``````

In [9]:

arr_row = np.arange(3).reshape(1, 3)
print(arr_row)

``````
``````

[[0 1 2]]

``````
``````

In [10]:

print(arr_row.shape)

``````
``````

(1, 3)

``````
``````

In [11]:

arr_col = np.arange(3).reshape(3, 1)
print(arr_col)

``````
``````

[[0]
[1]
[2]]

``````
``````

In [12]:

print(arr_col.shape)

``````
``````

(3, 1)

``````
``````

In [13]:

arr = np.arange(9).reshape(3, 3)
print(arr)

``````
``````

[[0 1 2]
[3 4 5]
[6 7 8]]

``````
``````

In [14]:

print(v @ arr)

``````
``````

[15 18 21]

``````
``````

In [15]:

print(arr_row @ arr)

``````
``````

[[15 18 21]]

``````
``````

In [16]:

print(arr @ v)

``````
``````

[ 5 14 23]

``````
``````

In [17]:

print(arr @ arr_col)

``````
``````

[[ 5]
[14]
[23]]

``````