![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
实用python标准库
煲饭酱
数据进阶路上的煲饭酱,和他背着的用来讨饭的锅
展开
-
【python Tips】那些事半功倍的数据结构和内置函数 TIPS
1. 排序相关列表排序输出对应的索引heights = [2,1,5,6,2,3]s = sorted(range(len(heights)), key=lambda k: heights[k])sOut[5]: [1, 0, 4, 5, 2, 3]原创 2021-10-27 22:47:39 · 172 阅读 · 0 评论 -
【python Tips】那些事半功倍的标准库(4-collections)
1. 模块:collections1.1 模块方法汇总['AsyncGenerator', 'AsyncIterable', 'AsyncIterator', 'Awaitable', 'ByteString', 'Callable', 'ChainMap', 'Collection', 'Container', 'Coroutine', 'Counter', 'Generator', 'Hashable', 'ItemsView', 'Iterable', 'Iterator', 'KeysVie原创 2021-10-08 22:49:32 · 191 阅读 · 0 评论 -
【python Tips】那些事半功倍的标准库(3-heapq)
1. 模块:heapq1.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 · 127 阅读 · 0 评论 -
【python Tips】那些事半功倍的标准库(2-bisect)
1. 模块:bisect1.1 模块方法汇总原创 2021-09-10 23:34:57 · 87 阅读 · 0 评论 -
【python Tips】那些事半功倍的标准库(1-itertools)
1. 模块:itertools1.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 · 82 阅读 · 0 评论