mrange is used to remove nested range loops
Project description
mrange
Install via
conda install numba
pip install mrange
Import via
from mrange import mrange
Description
mrange is used to remove nested range loops
Input:
n_s = (n_1, n_2, ..., n_m)
Tuple of integers (or array when using mrange_array
)
Output:
Generator outputting len(n_s)
values with every call, generating every combination of values in the intervals [0,1,...,n_s[i]-1]
Use:
for a, b, ..., m in mrange((n_a, n_b, ..., n_m)):
...
Replaces:
for a in range(n_a):
for b in range(n_b):
...
for m in range(n_m):
...
Authors:
By Michael Schilling, with the help of Francesco Preti
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mrange-1.2.tar.gz
(3.0 kB
view details)
Built Distribution
mrange-1.2-py3-none-any.whl
(3.3 kB
view details)
File details
Details for the file mrange-1.2.tar.gz
.
File metadata
- Download URL: mrange-1.2.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f69e717dfc8af586bc0291cff30dc7716baa1c5fbe769ec75b0ca271606879c |
|
MD5 | 0a062288121af72ec1669ba149c090f7 |
|
BLAKE2b-256 | 9cb2b6501f39676c268d2528caa4adf50dfd70ca89034801a829e0aaa618b31f |
File details
Details for the file mrange-1.2-py3-none-any.whl
.
File metadata
- Download URL: mrange-1.2-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cbf3d4044db21354037c9c0bc6441a52293492e0bffda257fc48c4868f83462 |
|
MD5 | ea9513b7898092be9c6dff4716f6761f |
|
BLAKE2b-256 | a58763bdde5b2c50d03ffeb5cc9a20fef02fa62e3a854206dc7f482b33b024f3 |