permutation-no-repetition


Namepermutation-no-repetition JSON
Version 0.10 PyPI version JSON
download
home_pagehttps://github.com/hansalemaos/permutation_no_repetition
SummaryPermutation without repetition - written in Cython - for Numpy
upload_time2023-11-21 01:40:41
maintainer
docs_urlNone
authorJohannes Fischer
requires_python
licenseMIT
keywords cython permutation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Permutation without repetition - written in Cython - for Numpy 

## pip install permutation-no-repetition

### Tested against Windows / Python 3.11 / Anaconda


### This module requires Cython and a C/C++ Compiler to be installed.

```python

	
This module provides a Cython-based utility for generating permutations (without repetitions!) of arrays, supporting various data types and dimensions.

Usage:
from permutation_no_repetition import cython_permutations
import numpy as np

inputarray1 = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=np.int32)
i1 = cython_permutations(inputarray1, start=0, end=-1)
print(i1)

inputarray2 = np.array(
    [
        [1, 2, 3, 4],
        [3, 3, 3, 6],
        [2, 0, 0, 2],
        [2, 0, 0, 2],
        [8, 2, 8, 2],
        [4, 5, 4, 5],
        [3, 3, 3, 6],
        [4, 5, 4, 5],
        [0, 9, 8, 7],
        [1, 2, 3, 4],
    ]
)
i2 = cython_permutations(inputarray2, start=0, end=-1)
print(i2)

inputarray3 = np.array(
    [
        100,
        1,
        2,
        2,
        3,
        4,
        115,
        5,
        6,
        7,
    ],
    dtype=np.float32,
)
i3 = cython_permutations(inputarray3, start=0, end=-1)
print(i3)

int_array_7 = np.array([1, 2, 3, 4, 5, 6, 7], dtype=np.int32)
test_int_array_7 = cython_permutations(int_array_7, start=0, end=-1)
print(test_int_array_7)
int_array_8 = np.array([1, 2, 3, 4, 5, 6, 7, 8], dtype=np.int64)
test_int_array_8 = cython_permutations(int_array_8, start=0, end=-1)
print(test_int_array_8)
int_array_9 = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=np.uint8)
test_int_array_9 = cython_permutations(int_array_9, start=0, end=-1)
print(test_int_array_9)
int_array_10 = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], dtype=np.uint16)
test_int_array_10 = cython_permutations(int_array_10, start=0, end=-1)
print(test_int_array_10)
float_array_7 = np.array([1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7], dtype=np.float32)
test_float_array_7 = cython_permutations(float_array_7, start=0, end=-1)
print(test_float_array_7)
float_array_8 = np.array([1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8], dtype=np.float64)
test_float_array_8 = cython_permutations(float_array_8, start=0, end=-1)
print(test_float_array_8)
complex_array_7 = np.array(
    [1 + 2j, 3 + 4j, 5 + 6j, 7 + 8j, 9 + 10j, 11 + 12j, 13 + 14j], dtype=np.complex64
)
test_complex_array_7 = cython_permutations(complex_array_7, start=0, end=-1)
print(test_complex_array_7)
complex_array_8 = np.array(
    [1 + 2j, 3 + 4j, 5 + 6j, 7 + 8j, 9 + 10j, 11 + 12j, 13 + 14j, 15 + 16j],
    dtype=np.complex128,
)
test_complex_array_8 = cython_permutations(complex_array_8, start=0, end=-1)
print(test_complex_array_8)
bool_array_7 = np.array([True, False, True, False, True, False, True], dtype=np.bool_)
test_bool_array_7 = cython_permutations(bool_array_7, start=0, end=-1)
print(test_bool_array_7)
str_array_7 = np.array(
    ["apple", "banana", "cherry", "date", "elderberry", "fig", "grape"], dtype=np.str_
)
test_str_array_7 = cython_permutations(str_array_7, start=0, end=-1)
print(test_str_array_7)
unicode_array_7 = np.array(["α", "β", "γ", "δ", "ε", "ζ", "η"], dtype=np.unicode_)
test_unicode_array_7 = cython_permutations(unicode_array_7, start=0, end=-1)
print(test_unicode_array_7)
bytes_array_7 = np.array([b"a", b"b", b"c", b"d", b"e", b"f", b"g"], dtype="S1")
test_bytes_array_7 = cython_permutations(bytes_array_7, start=0, end=-1)
print(test_bytes_array_7)
bytes_array_8 = np.array([b"a", b"b", b"c", b"d", b"e", b"f", b"g", b"h"], dtype="S1")
test_bytes_array_8 = cython_permutations(bytes_array_8, start=0, end=-1)
print(test_bytes_array_8)

```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hansalemaos/permutation_no_repetition",
    "name": "permutation-no-repetition",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "cython,Permutation",
    "author": "Johannes Fischer",
    "author_email": "aulasparticularesdealemaosp@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a9/bc/6d055f9b79df7186785ba3186f5786a408b676c912a95dbe89728c6db3c5/permutation_no_repetition-0.10.tar.gz",
    "platform": null,
    "description": "\r\n# Permutation without repetition - written in Cython - for Numpy \r\n\r\n## pip install permutation-no-repetition\r\n\r\n### Tested against Windows / Python 3.11 / Anaconda\r\n\r\n\r\n### This module requires Cython and a C/C++ Compiler to be installed.\r\n\r\n```python\r\n\r\n\t\r\nThis module provides a Cython-based utility for generating permutations (without repetitions!) of arrays, supporting various data types and dimensions.\r\n\r\nUsage:\r\nfrom permutation_no_repetition import cython_permutations\r\nimport numpy as np\r\n\r\ninputarray1 = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=np.int32)\r\ni1 = cython_permutations(inputarray1, start=0, end=-1)\r\nprint(i1)\r\n\r\ninputarray2 = np.array(\r\n    [\r\n        [1, 2, 3, 4],\r\n        [3, 3, 3, 6],\r\n        [2, 0, 0, 2],\r\n        [2, 0, 0, 2],\r\n        [8, 2, 8, 2],\r\n        [4, 5, 4, 5],\r\n        [3, 3, 3, 6],\r\n        [4, 5, 4, 5],\r\n        [0, 9, 8, 7],\r\n        [1, 2, 3, 4],\r\n    ]\r\n)\r\ni2 = cython_permutations(inputarray2, start=0, end=-1)\r\nprint(i2)\r\n\r\ninputarray3 = np.array(\r\n    [\r\n        100,\r\n        1,\r\n        2,\r\n        2,\r\n        3,\r\n        4,\r\n        115,\r\n        5,\r\n        6,\r\n        7,\r\n    ],\r\n    dtype=np.float32,\r\n)\r\ni3 = cython_permutations(inputarray3, start=0, end=-1)\r\nprint(i3)\r\n\r\nint_array_7 = np.array([1, 2, 3, 4, 5, 6, 7], dtype=np.int32)\r\ntest_int_array_7 = cython_permutations(int_array_7, start=0, end=-1)\r\nprint(test_int_array_7)\r\nint_array_8 = np.array([1, 2, 3, 4, 5, 6, 7, 8], dtype=np.int64)\r\ntest_int_array_8 = cython_permutations(int_array_8, start=0, end=-1)\r\nprint(test_int_array_8)\r\nint_array_9 = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=np.uint8)\r\ntest_int_array_9 = cython_permutations(int_array_9, start=0, end=-1)\r\nprint(test_int_array_9)\r\nint_array_10 = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], dtype=np.uint16)\r\ntest_int_array_10 = cython_permutations(int_array_10, start=0, end=-1)\r\nprint(test_int_array_10)\r\nfloat_array_7 = np.array([1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7], dtype=np.float32)\r\ntest_float_array_7 = cython_permutations(float_array_7, start=0, end=-1)\r\nprint(test_float_array_7)\r\nfloat_array_8 = np.array([1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8], dtype=np.float64)\r\ntest_float_array_8 = cython_permutations(float_array_8, start=0, end=-1)\r\nprint(test_float_array_8)\r\ncomplex_array_7 = np.array(\r\n    [1 + 2j, 3 + 4j, 5 + 6j, 7 + 8j, 9 + 10j, 11 + 12j, 13 + 14j], dtype=np.complex64\r\n)\r\ntest_complex_array_7 = cython_permutations(complex_array_7, start=0, end=-1)\r\nprint(test_complex_array_7)\r\ncomplex_array_8 = np.array(\r\n    [1 + 2j, 3 + 4j, 5 + 6j, 7 + 8j, 9 + 10j, 11 + 12j, 13 + 14j, 15 + 16j],\r\n    dtype=np.complex128,\r\n)\r\ntest_complex_array_8 = cython_permutations(complex_array_8, start=0, end=-1)\r\nprint(test_complex_array_8)\r\nbool_array_7 = np.array([True, False, True, False, True, False, True], dtype=np.bool_)\r\ntest_bool_array_7 = cython_permutations(bool_array_7, start=0, end=-1)\r\nprint(test_bool_array_7)\r\nstr_array_7 = np.array(\r\n    [\"apple\", \"banana\", \"cherry\", \"date\", \"elderberry\", \"fig\", \"grape\"], dtype=np.str_\r\n)\r\ntest_str_array_7 = cython_permutations(str_array_7, start=0, end=-1)\r\nprint(test_str_array_7)\r\nunicode_array_7 = np.array([\"\u03b1\", \"\u03b2\", \"\u03b3\", \"\u03b4\", \"\u03b5\", \"\u03b6\", \"\u03b7\"], dtype=np.unicode_)\r\ntest_unicode_array_7 = cython_permutations(unicode_array_7, start=0, end=-1)\r\nprint(test_unicode_array_7)\r\nbytes_array_7 = np.array([b\"a\", b\"b\", b\"c\", b\"d\", b\"e\", b\"f\", b\"g\"], dtype=\"S1\")\r\ntest_bytes_array_7 = cython_permutations(bytes_array_7, start=0, end=-1)\r\nprint(test_bytes_array_7)\r\nbytes_array_8 = np.array([b\"a\", b\"b\", b\"c\", b\"d\", b\"e\", b\"f\", b\"g\", b\"h\"], dtype=\"S1\")\r\ntest_bytes_array_8 = cython_permutations(bytes_array_8, start=0, end=-1)\r\nprint(test_bytes_array_8)\r\n\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Permutation without repetition - written in Cython - for Numpy",
    "version": "0.10",
    "project_urls": {
        "Homepage": "https://github.com/hansalemaos/permutation_no_repetition"
    },
    "split_keywords": [
        "cython",
        "permutation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "974b0b46ed586c10a41b7eb078a31ea80d941b7b403a8078b00465f96342128b",
                "md5": "fee4ea065a20e9c186105bc345ade386",
                "sha256": "98bb103c64d47e1df8f79974aa9270276f2da4b70e846484811bb8fe0e5dc75e"
            },
            "downloads": -1,
            "filename": "permutation_no_repetition-0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fee4ea065a20e9c186105bc345ade386",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 23729,
            "upload_time": "2023-11-21T01:40:39",
            "upload_time_iso_8601": "2023-11-21T01:40:39.842249Z",
            "url": "https://files.pythonhosted.org/packages/97/4b/0b46ed586c10a41b7eb078a31ea80d941b7b403a8078b00465f96342128b/permutation_no_repetition-0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a9bc6d055f9b79df7186785ba3186f5786a408b676c912a95dbe89728c6db3c5",
                "md5": "4fd12b7b4661e1b7f97f8e4c021d3e0d",
                "sha256": "cd4a0c6595d5a8fe799ad50803f7df7a5928e160da6e9b8f7d4a35e26eb902b8"
            },
            "downloads": -1,
            "filename": "permutation_no_repetition-0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "4fd12b7b4661e1b7f97f8e4c021d3e0d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 23645,
            "upload_time": "2023-11-21T01:40:41",
            "upload_time_iso_8601": "2023-11-21T01:40:41.420997Z",
            "url": "https://files.pythonhosted.org/packages/a9/bc/6d055f9b79df7186785ba3186f5786a408b676c912a95dbe89728c6db3c5/permutation_no_repetition-0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-21 01:40:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hansalemaos",
    "github_project": "permutation_no_repetition",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "permutation-no-repetition"
}
        
Elapsed time: 0.14692s