My personal functions.
Project description
My choice of missing python functions.
list.len() list.map(function) list.filter(function) list.join(separator) list.sortby(function) list.compact() list.freq(function=None) list.groupby(function=None) list.indexby(function=None) list.uniq() list.take(num) list.drop(num) list.first() list.last() list.zip() list.min() list.max() list.sum() list.reduce(function) list.reduce(initial, function)
Examples
$ python >>> import omakase >>> array = 'the quick brown fox jumps over the lazy dog'.split() >>> array.map(len) [3, 5, 5, 3, 5, 4, 3, 4, 3] >>> array.filter(lambda each: each > 'hello worlds') ['the', 'quick', 'jumps', 'over', 'the', 'lazy'] >>> array.take(3) ['the', 'quick', 'brown'] >>>
Installation
To install this package, run
pip install omakase
Contributing
Bug reports and pull requests are welcome on github at, https://github.com/akuhn/py-omakase
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
omakase-0.7.0.tar.gz
(1.8 kB
view details)
File details
Details for the file omakase-0.7.0.tar.gz
.
File metadata
- Download URL: omakase-0.7.0.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.10.0 pkginfo/1.4.2 requests/2.9.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.19.8 CPython/2.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ef836033d9c90a5e6d2232ab4bc2cc322a8e6d5dcc087f9ebe441577fdaa912 |
|
MD5 | 39634ae9df20fb35c57e346b4425f765 |
|
BLAKE2b-256 | 29d986169b5fa3f0892d6f850820605bb4f797aa13508c9fcef22a6b70b3fff8 |