Python Forum
compare and find the nearest element ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
compare and find the nearest element ?
#5
If your problem is "nearest" match to a list of numbers,
you can easily write a small example program to demonstrate the problem .
While doing that, you may find that the python module "bisect"
comes very close to what you want, if I understand your question correctly.
Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply


Messages In This Thread
RE: compare and find the nearest element ? - by DPaul - Jan-15-2023, 07:11 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Writing a cycle to find the nearest point from the array Tysrusko 0 194 May-10-2024, 11:49 AM
Last Post: Tysrusko
  Get numpy ceil and floor value for nearest two decimals klllmmm 4 1,385 Jun-07-2023, 07:35 AM
Last Post: paul18fr
  Find (each) element from a list in a file tester_V 3 1,289 Nov-15-2022, 08:40 PM
Last Post: tester_V
  [SOLVED] [Beautifulsoup] Find if element exists, and edit/append? Winfried 2 4,440 Sep-03-2022, 10:14 PM
Last Post: Winfried
  How to find the second lowest element in the list? Anonymous 3 2,094 May-31-2022, 01:58 PM
Last Post: Larz60+
  Compare each element of an array in a logic statement without using a for loop leocsmith 3 5,977 Apr-01-2021, 07:57 PM
Last Post: deanhystad
  Rounding to the nearest eight wallgraffiti 2 2,149 Jul-15-2020, 06:05 PM
Last Post: wallgraffiti
  how to compare two different size images in python and find corresponding pixel value squidsirymchenry 1 4,649 Feb-03-2020, 06:48 AM
Last Post: michael1789
  find nearest number d3fi 7 4,042 Aug-26-2019, 09:32 PM
Last Post: ichabod801
  Finding nearest point of a Multidigraph in Python 3.7 stixmagiggins 5 3,884 Aug-24-2019, 08:51 AM
Last Post: ThomasL

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020