[Numpy-discussion] finding close together points.

Charles R Harris charlesr.harris at gmail.com
Thu Nov 12 17:37:36 EST 2009


On Thu, Nov 12, 2009 at 3:30 PM, Charles R Harris <charlesr.harris at gmail.com
> wrote:

>
>
> On Thu, Nov 12, 2009 at 12:52 PM, Christopher Barker <
> Chris.Barker at noaa.gov> wrote:
>
>> Robert Kern wrote:
>>
>> > Didn't we already do this?
>> >
>> > http://www.mail-archive.com/numpy-discussion@scipy.org/msg21010.html
>>
>> Indeed we did. What I posted then ( and have improved a bit now). Is a
>> Python version. Written in Python, it has an advantage of using less
>> memory for a big array, but is slower in other respects than a Python
>> list. This is probably why we all use lists for this when we need it!
>>
>>
> IIRC, python lists *are* expanding arrays of contiguous memory, not linked
> lists. They are efficient for appending and indexing, less so for deletion
> and insertion. It's one of those tradeoffs. So what you buy with an array
> implementation is the space/time efficiency of not having to allocate python
> types to put on the list. But you probably need to go through a python type
> at some point anyway, so...
>
>
And here is a pep <http://www.python.org/dev/peps/pep-3128/%20> for a Blist
with a table of some of the performance tradeoffs. I think you could use
small ndarrays in the leaf nodes and get around having to handle all the
type stuff.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20091112/917360e6/attachment.html>


More information about the NumPy-Discussion mailing list