# How to Perform Vector Hadamard Multiplication in Python

Hadamard multiplication, also known as element-wise multiplication, involves multiplying two vectors of the same dimension, element by element.

Let’s begin by examining two column vectors:

We perform Hadamard multiplication as follows:

To demonstrate this operation using Python, we initiate by creating two vectors of equal dimensions:

```import numpy as np

# Vector 1
vector1 = np.array([[1], [2], [3]])

# Vector 2
vector2 = np.array([[4], [5], [6]])

# Print the shapes of Vector 1 and Vector 2
print("Shape of Vector 1:", vector1.shape)
print("Shape of Vector 2:", vector2.shape)
```

Expected output confirming their dimensions:

```Shape of Vector 1: (3, 1)
Shape of Vector 2: (3, 1)
```

```# Hadamard multiplication of Vectors 1 and 2
result = vector1 * vector2
```

Viewing the results:

```# Output result and shape
print(result)
print("Shape of Result:", result.shape)
```

Output of the operation:

```Result of Hadamard Multiplication:
[[ 4]
[10]
[18]]

Shape of Result: (3, 1)
```

The resulting operation of Hadamard Multiplication will always have the same shape or dimension as the original vectors.

What if we attempt this operation with vectors of mismatched sizes? Here’s an example to illustrate:

```import numpy as np

# Vector 1
vector1 = np.array([[1], [2], [3]])

# Vector 3 with fewer elements
vector3 = np.array([[8], [9]])

try:
result = vector1 * vector3
print(result)
except ValueError as e:
```Error during Hadamard multiplication: