[Numpy-discussion] Numpify this?

Matt Crane matt at snapbug.geek.nz
Sun May 18 22:24:39 EDT 2008


On Sun, May 18, 2008 at 9:14 PM, Anne Archibald
<peridot.faceted at gmail.com> wrote:
> 2008/5/18 Matt Crane <matt at snapbug.geek.nz>:
>> On Sun, May 18, 2008 at 8:52 PM, Robert Kern <robert.kern at gmail.com> wrote:
>>> Are there repeats?
>> No, no repeats in the first column.
>>
>> I'm going to go get a cup of coffee before I forget to leave out any
>> potentially vital information again. It's going to be a long day.
>
> It can be done, though I had to be kind of devious. My solution might
> not even be O(n log n), depending on how mergesort is implemented:
>
Although this O(n log n) solution is written in numpy - and let's
assume that the mergesort is implemented to give that.

That's O(n log n) where n is the combined sizes of the arrays -
although given that they are already sorted it might be straight
linear because it only has to merge them? I know for sure that the
solution that I originally posted was linear in terms of the combined
sizes. While it might be slow because it's written in straight python
- it perhaps might be quicker if one were to use scipy.weave
blitz/inline?

I think I might leave the discussion here until I can get some
benchmarking on the different alternatives - thanks all.
Matt



More information about the NumPy-Discussion mailing list