
实用python标准库
煲饭酱
数据进阶路上的煲饭酱,和他背着的用来讨饭的锅
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【python Tips】那些事半功倍的数据结构和内置函数 TIPS
1. 排序相关 列表排序输出对应的索引 heights = [2,1,5,6,2,3] s = sorted(range(len(heights)), key=lambda k: heights[k]) s Out[5]: [1, 0, 4, 5, 2, 3]原创 2021-10-27 22:47:39 · 252 阅读 · 0 评论 -
【python Tips】那些事半功倍的标准库(4-collections)
1. 模块:collections 1.1 模块方法汇总 ['AsyncGenerator', 'AsyncIterable', 'AsyncIterator', 'Awaitable', 'ByteString', 'Callable', 'ChainMap', 'Collection', 'Container', 'Coroutine', 'Counter', 'Generator', 'Hashable', 'ItemsView', 'Iterable', 'Iterator', 'KeysVie原创 2021-10-08 22:49:32 · 291 阅读 · 0 评论 -
【python Tips】那些事半功倍的标准库(3-heapq)
1. 模块:heapq 1.1 模块方法汇总 __all__ = ['heappush', 'heappop', 'heapify', 'heapreplace', 'merge', 'nlargest', 'nsmallest', 'heappushpop'] """ heappush: Push item onto heap, maintaining the heap invariant. heappop: Pop the smallest item off the heap,原创 2021-09-12 20:43:36 · 195 阅读 · 0 评论 -
【python Tips】那些事半功倍的标准库(2-bisect)
1. 模块:bisect 1.1 模块方法汇总原创 2021-09-10 23:34:57 · 142 阅读 · 0 评论 -
【python Tips】那些事半功倍的标准库(1-itertools)
1. 模块:itertools 1.1 模块方法汇总 """ Functional tools for creating and using iterators. >>> Infinite iterators: count(start=0, step=1) --> start, start+step, start+2*step, ... cycle(p) --> p0, p1, ... plast, p0, p1, ... repeat(elem [,n]) -->原创 2021-09-10 23:31:21 · 141 阅读 · 0 评论