On Wed, May 16, 2012 at 5:38 AM, Jean-Daniel wrote:
> On Sun, May 13, 2012 at 2:29 PM, Alec Taylor
> wrote:
> > There is an ordered dict type since Python 3.1[1] and Python 2.7.3[2].
>
> Ordered dict are useful, but they only remember the ordered in which
> they were added, you can not order them
On Sun, May 13, 2012 at 2:29 PM, Alec Taylor wrote:
> There is an ordered dict type since Python 3.1[1] and Python 2.7.3[2].
Ordered dict are useful, but they only remember the ordered in which
they were added, you can not order them a on key.
Thanks for the links.
>
> If you are looking for th
Am 12.05.2012 14:17, schrieb Jean-Daniel:
> Hello,
>
> I have a long list of n date intervals that gets added or suppressed
> intervals regularly. I am looking for a fast way to find the intervals
> containing a given date, without having to check all intervals (less
> than O(n)).
>
> Do you know
On Sat, May 12, 2012 at 10:18 AM, Jean-Daniel
wrote:
>> Since you say "intervals" in plural here, I assume that they can overlap?
>
> Yes,
>
> For instance, there are the following intervals :
> [[1, 10],
> [4, 7],
> [6, 15],
> [11, 17]]
>
> asking for the intervals including 5, the returned valu
On 5/12/2012 5:17 AM Jean-Daniel said...
Hello,
I have a long list of n date intervals that gets added or suppressed
intervals regularly. I am looking for a fast way to find the intervals
containing a given date, without having to check all intervals (less
than O(n)).
ISTM the fastest way is t
On 13 May 2012 13:29, Alec Taylor wrote:
> There is an ordered dict type since Python 3.1[1] and Python 2.7.3[2].
I don't think that'll help the OP. Python's OrderedDict keeps track
of the order in which the keys were inserted into the dictionary (a
bit like a list), it doesn't keep the keys sor
There is an ordered dict type since Python 3.1[1] and Python 2.7.3[2].
If you are looking for the best possible self-sorting structure for
searching, then perhaps you are looking for what's outlined in the
2002 article by Han & Thorup: Integer Sorting in O(n sqrt(log log n))
Expected Time and Line
Probably boost ITL (Interval Template Library) would serve as a good example.
I
noticed recently someone created an interface for python.
--
http://mail.python.org/mailman/listinfo/python-list
> Since you say "intervals" in plural here, I assume that they can overlap?
Yes,
For instance, there are the following intervals :
[[1, 10],
[4, 7],
[6, 15],
[11, 17]]
asking for the intervals including 5, the returned value should be
[[1, 10],
[4, 7]]
The idea here to make it fast is to have
On 12/05/2012 13:17, Jean-Daniel wrote:
Hello,
Do you know the best way to do this in Python with the stdlib?
Sorry, not part of the stdlib but search for red black tree here
http://pypi.python.org/pypi. While you're there also take a look at the
blist package.
--
Cheers.
Mark Lawrence
On Sat, May 12, 2012 at 8:17 AM, Jean-Daniel
wrote:
> I am looking for a fast way to find the intervals
> containing a given date, without having to check all intervals (less
> than O(n)).
Since you say "intervals" in plural here, I assume that they can overlap?
--
~Zahlman {:>
--
http://mail.
Hello,
I have a long list of n date intervals that gets added or suppressed
intervals regularly. I am looking for a fast way to find the intervals
containing a given date, without having to check all intervals (less
than O(n)).
Do you know the best way to do this in Python with the stdlib?
A var
12 matches
Mail list logo