list interval index

Tim Golden tim.golden at viacom-outdoor.co.uk
Mon Jun 7 06:27:50 EDT 2004


| What is the fastest python code to get the index of a huge
| list of incrementing interval numbers, given a number?

Given that it's already sorted, it looks like a 
job for the (unsung) bisect module:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/54159

TJG


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________




More information about the Python-list mailing list