Allows for doing mathematical sigma and pi notation.
Project description
shigma
Shigma is a Python package allowing for sigma (Σ) and pi (Π) notation. It is very easy to learn and works like you'd expect. You'l get the hang of it very fast.
How to use
Sigma
Envision yourself a sigma notation. $$\sum_{i=1}^{10} i^2$$ is this it? This is how you write that in raw Python:
arr = []
for i in range(1, 10 + 1):
arr.append(i**2)
out = sum(arr)
This is how you write that with shigma. This is how you'd write that with shigma.
out = sigma_not(1, "i**2", 10)
Seems simple enough, right? If you are weird, or appreciate how unicode has become the standard encoding ¯\_(ツ)_/¯. Use the unicode symbol instead!
out = Σ(1, "i**2", 10)
Yeah, unprofessional I know.
Pi
You'll probably be using prodcut notation a lot too. To rewrite this: $$\prod_{i=1}^{10} i^2$$ into Python with the shigma package, you write this
out = pi_not(1, "i**2", 10)
unless of course...
out = Π(1, "i**2", 10)
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.