- 授权协议: 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}
数据结构 Python语言描述
[美] Kenneth A. Lambert 兰伯特 / 李军 / 人民邮电出版社 / 2017-12-1 / CNY 69.00
在计算机科学中,数据结构是一门进阶性课程,概念抽象,难度较大。Python语言的语法简单,交互性强。用Python来讲解数据结构等主题,比C语言等实现起来更为容易,更为清晰。 《数据结构 Python语言描述》第1章简单介绍了Python语言的基础知识和特性。第2章到第4章对抽象数据类型、数据结构、复杂度分析、数组和线性链表结构进行了详细介绍,第5章和第6章重点介绍了面向对象设计的相关知识、......一起来看看 《数据结构 Python语言描述》 这本书的介绍吧!
