
内置库
GISer_流浪
来自GIS专业的三流程序猿
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
滑动窗口的中值--bisect解法
中位数是有序序列最中间的那个数。如果序列的大小是偶数,则没有最中间的数;此时中位数是最中间的两个数的平均数leetcode链接使用bisect效率高于建立最大堆和最小堆函数文档bisect.insort(sorted_list, nums[p2]) bisect.insort(a, x) Insert item x in list a, and keep it sorted ass...原创 2020-04-12 22:15:41 · 313 阅读 · 0 评论 -
python内置库--排列组合
from itertools import permutations, combinationsres = permutations(range(3), 2)print(list(res))# (0,1), (0,2), (1,0), (1,2), (2,0), (2,1)res = permutations([0,0,1,1], 2)print(set(list(res)))re...原创 2020-04-12 22:45:11 · 1191 阅读 · 0 评论