Question: Using python, how to find the closest entry from multiple data arrays to a predetermined data array. I have the predetermined data array of: pre_array

Using python, how to find the closest entry from multiple data arrays to a predetermined data array. I have the predetermined data array of:

pre_array = [-25.502515804560772, -10.35786743290575, -6.451471264367818]

and I want to find from a csv file containing many other data arrays the closest data array to the above pre_array. The csv file contains for example the following

-36.519003 7.16886667 2.503
-33.242003 7.34686667 2.368
-33.242003 7.34686667 2.368
-29.816003 7.33286667 2.362
-29.816003 7.33286667 2.362
-26.798003 7.25986667 2.1
-26.798003 7.25986667 2.1
-24.190003 7.26086667 1.731
-24.190003 7.26086667 1.731
-21.239003 7.26486667 1.434
-21.239003 7.26486667 1.434
-18.229003 7.25186667 1.188
-18.229003 7.25186667 1.188
-15.593003 7.26486667 1.025
-15.593003 7.26486667 1.025
-13.148003 7.21686667 0.913

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!