Comparing sequences with range objects

Dan Stromberg drsalists at gmail.com
Sun Apr 10 23:15:03 EDT 2022


Two more things:
1) There are also modules that do interval arithmetic with reals, not just
integers.  EG: https://pyinterval.readthedocs.io/en/latest/
2) If you don't mind a small amount of inaccuracy you can often get things
down to less than one bit per element for presence/absence, using a bloom
filter.  EG: https://pypi.org/project/drs-bloom-filter/

On Sun, Apr 10, 2022 at 5:31 PM Dan Stromberg <drsalists at gmail.com> wrote:

>
> It sounds a little like you're looking for interval arithmetic.
>
> Maybe https://pypi.org/project/python-intervals/1.5.3/ ?
>
> On Thu, Apr 7, 2022 at 4:19 AM Antoon Pardon <antoon.pardon at vub.be> wrote:
>
>> I am working with a list of data from which I have to weed out duplicates.
>> At the moment I keep for each entry a container with the other entries
>> that are still possible duplicates.
>>
>> The problem is sometimes that is all the rest. I thought to use a range
>> object for these cases. Unfortunatly I sometimes want to sort things
>> and a range object is not comparable with a list or a tuple.
>>
>> So I have a list of items where each item is itself a list or range
>> object.
>> I of course could sort this by using list as a key function but that
>> would defeat the purpose of using range objects for these cases.
>>
>> So what would be a relatively easy way to get the same result without
>> wasting
>> too much memory on entries that haven't any weeding done on them.
>>
>> --
>> Antoon Pardon.
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>


More information about the Python-list mailing list