splitlistatindex


Namesplitlistatindex JSON
Version 0.10 PyPI version JSON
download
home_pagehttps://github.com/hansalemaos/splitlistatindex
SummarySplits a list into sublists based on either a list of indices or a number of sections.
upload_time2023-10-15 04:12:38
maintainer
docs_urlNone
authorJohannes Fischer
requires_python
licenseMIT
keywords fast-forward rewind loop
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Splits a list into sublists based on either a list of indices or a number of sections.

## Tested against Windows / Python 3.11 / Anaconda

## pip install splitlistatindex

```python
from splitlistatindex import list_split
l1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
l2 = [3, 5, 7, 8, 12]

# Split `l1` using a list of indices
result1 = list_split(l=l1, indices_or_sections=l2)
# result1 will be: [[0, 1, 2], [3, 4], [5, 6], [7], [8, 9]]

# Split `l1` into 3 sections
result2 = list_split(l=l1, indices_or_sections=3)
# result2 will be: [[0, 1, 2, 3], [4, 5, 6], [7, 8, 9]]

```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hansalemaos/splitlistatindex",
    "name": "splitlistatindex",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "fast-forward,rewind,loop",
    "author": "Johannes Fischer",
    "author_email": "aulasparticularesdealemaosp@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/10/8e/674288673ac52e5fc287a710bfe38896593778b48f62440d10d470329341/splitlistatindex-0.10.tar.gz",
    "platform": null,
    "description": "\r\n# Splits a list into sublists based on either a list of indices or a number of sections.\r\n\r\n## Tested against Windows / Python 3.11 / Anaconda\r\n\r\n## pip install splitlistatindex\r\n\r\n```python\r\nfrom splitlistatindex import list_split\r\nl1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\r\nl2 = [3, 5, 7, 8, 12]\r\n\r\n# Split `l1` using a list of indices\r\nresult1 = list_split(l=l1, indices_or_sections=l2)\r\n# result1 will be: [[0, 1, 2], [3, 4], [5, 6], [7], [8, 9]]\r\n\r\n# Split `l1` into 3 sections\r\nresult2 = list_split(l=l1, indices_or_sections=3)\r\n# result2 will be: [[0, 1, 2, 3], [4, 5, 6], [7, 8, 9]]\r\n\r\n```\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Splits a list into sublists based on either a list of indices or a number of sections.",
    "version": "0.10",
    "project_urls": {
        "Homepage": "https://github.com/hansalemaos/splitlistatindex"
    },
    "split_keywords": [
        "fast-forward",
        "rewind",
        "loop"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1af0a81c88442e4222d34efe6aec83dda78ccbd92188d875a8831bdd7728a2a1",
                "md5": "fda6c504db6e78fbec80eaf55579d08a",
                "sha256": "bcb918098a187452651eead61367b61f86adc8c04c1c16317ae0bda12d921957"
            },
            "downloads": -1,
            "filename": "splitlistatindex-0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fda6c504db6e78fbec80eaf55579d08a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4343,
            "upload_time": "2023-10-15T04:12:36",
            "upload_time_iso_8601": "2023-10-15T04:12:36.569409Z",
            "url": "https://files.pythonhosted.org/packages/1a/f0/a81c88442e4222d34efe6aec83dda78ccbd92188d875a8831bdd7728a2a1/splitlistatindex-0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "108e674288673ac52e5fc287a710bfe38896593778b48f62440d10d470329341",
                "md5": "3b977783095606e5af4f15c652e933db",
                "sha256": "9fdae4c6876ebf3389f45c5fba7aec91636ca8edaa35be5cc6ece96f77592dbf"
            },
            "downloads": -1,
            "filename": "splitlistatindex-0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "3b977783095606e5af4f15c652e933db",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3418,
            "upload_time": "2023-10-15T04:12:38",
            "upload_time_iso_8601": "2023-10-15T04:12:38.647389Z",
            "url": "https://files.pythonhosted.org/packages/10/8e/674288673ac52e5fc287a710bfe38896593778b48f62440d10d470329341/splitlistatindex-0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-15 04:12:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hansalemaos",
    "github_project": "splitlistatindex",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "splitlistatindex"
}
        
Elapsed time: 0.13992s