No project description provided
Project description
This package is intended to operate as a simple intuitive interface for handling laborious elementary set theory calculations. The goal is to make all operations on sets feel intuitive and number like (similar to MATLAB's handling of matrices)!
Installation
Ensure that Python is installed on your machine then run pip install SetCalcPy
Invoke import SetCalcPy
in your file or console!
Enjoy!
Simple Operations
- Declare sets like so
A = Set(1,2,3)
and `B = Set(1,2,Set(3,4)) - Take the union of two sets (find all elements in
A
orB
):A + B
- Take the intersection of two sets (find all elements in
A
andB
):A & B
- Take the disjoint of two sets (find all elements in
A
but notB
):A - B
- Find the powerset of a set (all subsets of
A
):A.powerSet()
- Calculate the cartesian product of two or more sets:
A * B
orA.cartesianProduct(*sets to multiply by*)
- Find the complement of a set (all elements in the universe specified but not in
A
):A.complement()
Other Features
- Iterate through sets just like lists
- Access elements just like lists (the first element of
A
isA[0]
) - Test set equality:
A == B
- Convert to a list:
A.__list__()
- Check for membership:
1 in A
evaluates to True because 1 is an element ofA
- Check length:
len(A)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
SetCalcPy-1.1.1-py3-none-any.whl
(17.1 kB
view hashes)
Close
Hashes for SetCalcPy-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7706a8abf99d49b12240474ba48d7aa7a26203cf1d1860123df7f335018eff37 |
|
MD5 | 559eba7e43f06a280bbc070f6d613979 |
|
BLAKE2b-256 | c26d2e1ff59f3ee538b8abbd28ed6a68b2bc99460a2a2f3181493a924cd0507b |