- 授权协议: BSD
- 开发语言: Python
- 操作系统: 跨平台
- 软件首页: https://github.com/pytoolz/toolz/
- 软件文档: http://toolz.readthedocs.org/en/latest/
软件介绍
Toolz 是 Python 的函数式编程工具箱。Toolz 支持 Python 2.6+ 和 Python 3.3+。
Toolz 的实现包括三部分:
itertoolz,for operations on iterables. 例如:groupby,unique,interpose,functoolz, for higher-order functions. 例如:memoize,curry,composedicttoolz, for operations on dictionaries. 例如:assoc,update-in,merge.
示例:
>>> def stem(word):
... """ Stem word to primitive form """
... return word.lower().rstrip(",.!:;'-\"").lstrip("'\"")
>>> from toolz import compose, frequencies, partial
>>> wordcount = compose(frequencies, partial(map, stem), str.split)
>>> sentence = "This cat jumped over this other cat!"
>>> wordcount(sentence)
{'this': 2, 'cat': 2, 'jumped': 1, 'over': 1, 'other': 1}
Cyberwar
Kathleen Hall Jamieson / Oxford University Press / 2018-10-3 / USD 16.96
The question of how Donald Trump won the 2016 election looms over his presidency. In particular, were the 78,000 voters who gave him an Electoral College victory affected by the Russian trolls and hac......一起来看看 《Cyberwar》 这本书的介绍吧!
