Skip to main content

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

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.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

mrange-1.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file mrange-1.1.tar.gz.

File metadata

  • Download URL: mrange-1.1.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

Hashes for mrange-1.1.tar.gz
Algorithm Hash digest
SHA256 ac12871694e7a7c0f836b541603cc3a07f1f34bd7240ef31a62d24e851383dbe
MD5 dfefcfd6da6de02b17d2e1caab621580
BLAKE2b-256 7f4211ab9e0952a8fd7e69038f140b46a17e1b3aed4d4baaad9c47357942192c

See more details on using hashes here.

File details

Details for the file mrange-1.1-py3-none-any.whl.

File metadata

  • Download URL: mrange-1.1-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

Hashes for mrange-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 19f383a7cb636f84a1442b89ac6469766979dc6676e10a27cc2c829c41fc7333
MD5 da5fa3ade0c9011d0542eaa3a7f8faa1
BLAKE2b-256 fafd34d9edcb6f1b5d81215c021df0d03a934437b19f95bd188c85b39f3e2f54

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page