Reputation: 35301
Given an ordered list A
of integers, and an integer q <= A[-1]
, I want to find the smallest non-negative index i
such that A[i] >= q
.
I can think of ways to do this efficiently (e.g. with some form of binary search), but I'd like to know if there's anything in either Python's standard library or in numpy/scipy that I can use to implement this.
(For example, something analogous to MATLAB's interp1
function.)
Upvotes: 2
Views: 50