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

Uploaded Source

Built Distribution

mrange-0.8-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mrange-0.8.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.7

File hashes

Hashes for mrange-0.8.tar.gz
Algorithm Hash digest
SHA256 285a169a352b1150b0d0c3cb6f59785c191876e69ade75e25e336a86b42b9238
MD5 8e93f1b35cea609ac74bf8c8906880c9
BLAKE2b-256 c84f01ac176ceda2bcc9ee834abffab163d61bfc0f44c8e09edbaaaaf0a1e2c4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mrange-0.8-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.7

File hashes

Hashes for mrange-0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 63fda79f9cb8d1b31bf467d2e859be2ca162f3439a9e0baa52c0f6a5e040b4fa
MD5 fc3b6d058566c146b6cdfd0693135470
BLAKE2b-256 279745d014ccb7c5b0f1e9c9f69a128c55163e1c4a0e5e0082a1f1b6a73b841c

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