Partition a list by a condition on the sublists.
Project description
partition-while
The function partition-while splits a collection into sublists comprised of consecutive elements which satisfy a given condition.
For example:
from partition_while.core import partition_while
print(partition_while([1,2,3,4,5,6,7,8,9,10], lambda x: sum(x) <= 10))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
partition_while-0.1.0.tar.gz
(1.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file partition_while-0.1.0.tar.gz.
File metadata
- Download URL: partition_while-0.1.0.tar.gz
- Upload date:
- Size: 1.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4ab1b03ddbd1a12606cc78a17e1146e25bcb3d64ef7c4ee1b77f2728fd475ec
|
|
| MD5 |
95aebe6eaa4539a2229c4b7c8cfa74b4
|
|
| BLAKE2b-256 |
7c6ff2b3be5e7187169183149b19bc7ad4f34c32105f345b1b6c1ca003dc2cb1
|
File details
Details for the file partition_while-0.1.0-py3-none-any.whl.
File metadata
- Download URL: partition_while-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bbce6bf2d365ba1a816a19606fff5da8813ed4e4d79e7917b5176d72a295be7
|
|
| MD5 |
faba0852b998b108ae47d24bccae32a0
|
|
| BLAKE2b-256 |
6aaefe1bc763a2f2bd388bd266d7098515279412cf9951931311b21c2c21af3f
|