searchsorted(arr, x, 'left') returns the position i such that arr[i-1] < x <= arr[i],
so that i is the first one such that x <= arr[i]. Equivalent to lower_bound in c++
searchsorted(arr, x, 'right') returns the position i such that arr[i-1] <= x < arr[i],
so that i is the first one such that x < arr[i]. Equivalent to upper_bound in c++
Created
December 13, 2018 08:48
-
-
Save liushapku/a658c2d76adbf515bacf0052eb389152 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment