Q.2 How will you measure the Euclidean distance between the two arrays in numpy?

Ans. In order to measure the Euclidean distance between the two arrays, we will first initialize our two arrays, then we will use the linalg.norm() function provided by the numpy library. Here, numpy is imported as np.

a = np.array([1,2,3,4,5])

b = np.array([6,7,8,9,10])

# Solution

e_dist = np.linalg.norm(a-b)

e_dist

11.180339887498949

With data integrity, we can define the accuracy as well as the consistency of the data. This integrity is to be ensured over the entire life-cycle.


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *