A functional interface for python iterator
Project description
functionalstream
Installation
pip install functionalstream
Example
from functionalstream import Stream
# lst1 = [0, 6, 12, 18, 24]
lst1 = Stream(range(10)).filter(lambda x: x % 2 == 0).map(lambda x: x * 3).to_list()
# lst2 = [(1, 2), (3, 4)]
lst2 = Stream([(1,2), (3,4), (6,5)]).filter(lambda x, y: x < y, star=True).to_list()
# array = array([0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
array = Stream(range(10)).to_numpy_array(dtype=float)
# for function which has side effect
Stream(range(10)).apply(lambda x: print(x))
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
functionalstream-0.1.6.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for functionalstream-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c42eaea2a4afaecc3a2f79db05be40d31de06a1e89b3bdde71a68b49b2c37eb4 |
|
MD5 | e1e72f5cac5279c6b28d9f160c89d1ca |
|
BLAKE2b-256 | ff672b619e89a21ad613f1722037df572c7ced582fd59250930caf649fd59c72 |