Algebra of Sets
Project description
How to have a set containing all real numbers from 1 to 10 not including 10?
How to add interval from 20 to 30 to the set?
How to make sure this set is a subset of set of positive numbers?
How to add scalar number to it?
How to get complement of the set?
>>> from set_algebra import Interval, Set >>> s = Set('[1, 10)') >>> 1 in s True >>> 10 in s False >>> s.add(Interval('[20, 30]')) >>> 25 in s True >>> s <= Set('(0, inf)') True >>> s.add(100) >>> s.notation '[1, 10), [20, 30], {100}' >>> (~s).notation '(-inf, 1), [10, 20), (30, 100), (100, inf)'
Set-Algebra provides classes representing math concepts:
- Infinity
- Endpoint
- Interval
- Uncountable Infinite Set
Besides numbers, Set-Algebra supports all objects that can be compared to each other - strings, datetimes, etc.
Infinity() is greater than any of these objects except float(‘inf’) and float(‘nan’). NegativeInfinity included as well.
Set-Algebra fully supports Python3. Tested on python 2.7, 3.2 - 3.6.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Built Distributions
Close
Hashes for set_algebra-0.3.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1ac48fa68e3761288254e25ebe29e89566bbca5ec6b7feefdeebad8f02d4e80 |
|
MD5 | f6941e88bfd4df2604a6e0697dd8ccdb |
|
BLAKE2-256 | 929b57919d00054951f770768e10bd25bfc8973d7d099acb1be6ab6456e1e175 |
Close
Hashes for set_algebra-0.3.5-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8402b231c711e7a94a135659512d8c40cc8205dad29f30178a81a050eab765c1 |
|
MD5 | 3e710f0623f872e4c2889a0923bb9256 |
|
BLAKE2-256 | bb4f30f0c28373b5272428fe9d6045957840992b56d14671c7fb20754fff4623 |