Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Fast Cython searchsorted for both arrays sorted
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Keith Goodman  
View profile  
 More options Jun 4 2012, 3:19 pm
From: Keith Goodman <kwgood...@gmail.com>
Date: Mon, 4 Jun 2012 12:19:02 -0700
Local: Mon, Jun 4 2012 3:19 pm
Subject: Re: Fast Cython searchsorted for both arrays sorted

> ---------- Forwarded message ----------
> From: Tom Aldcroft
> Date: Mon, Jun 4, 2012 at 2:13 PM
> Subject: Fast Cython searchsorted for both arrays sorted
> To: bottle-neck@googlegroups.com

> I just saw the announce for bottleneck 0.6.  This looks really useful!
>  By coincidence this weekend I wrote a little Cython code to replace
> np.searchsorted(a, v) for the special case when both arrays are
> sorted.  When this is the case and len(v) > len(a) / 100 (roughly
> speaking) then the Cython version is 10 to 20 times faster.  This use
> case is pretty common in my work, for instance in regridding
> coordinate data etc.  Here is the code, first the Cython code and then
> the Python wrapper function:

> https://github.com/sot/Ska.Numpy/blob/master/Ska/Numpy/fastss.pyx
> https://github.com/sot/Ska.Numpy/blob/master/Ska/Numpy/Numpy.py#L427

Nice. I opened an issue: https://github.com/kwgoodman/bottleneck/issues/47

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.