随笔分类 -  python

Python 模块 | multiprocessing
摘要:https://juejin.im/post/5c07b27af265da611b58234c multiprocessing.Process multiprocessing.Queue 阅读全文

posted @ 2020-03-17 17:17 TMatrix52 阅读(112) 评论(0) 推荐(0) 编辑

numpy.pad 用法
摘要:https://docs.scipy.org/doc/numpy/reference/generated/numpy.pad.htmlhttps://cugtyt.github.io/blog/2017/11022006.html>>> import numpy as np >>> a = np.a 阅读全文

posted @ 2020-03-01 17:09 TMatrix52 阅读(153) 评论(0) 推荐(0) 编辑

collections.defaultdict()
摘要:https://www.cnblogs.com/herbert/archive/2013/01/09/2852843.html 阅读全文

posted @ 2019-11-14 19:57 TMatrix52 阅读(97) 评论(0) 推荐(0) 编辑

python 根据两个字段排序, 一个升序, 一个降序
摘要:from collections import Counter c = Counter(input()) l=sorted(c.items(), key=lambda s:(-s[1], s[0])) for i in l[:3]: print(' '.join(map(str, list(i)))) 阅读全文

posted @ 2019-08-25 16:52 TMatrix52 阅读(1082) 评论(0) 推荐(0) 编辑

python中yield的用法
摘要: 阅读全文

posted @ 2019-07-30 08:59 TMatrix52 阅读(131) 评论(0) 推荐(0) 编辑

用Python提取中文关键词
摘要:如何用Python提取中文关键词? 阅读全文

posted @ 2019-02-14 13:31 TMatrix52 阅读(258) 评论(0) 推荐(0) 编辑

Python heapq模块
摘要:注意,默认的heap是一个小顶堆! heapq模块提供了如下几个函数: heapq.heappush(heap, item) 把item添加到heap中(heap是一个列表) heapq.heappop(heap) 把堆顶元素弹出,返回的就是堆顶 heapq.heappushpop(heap, it 阅读全文

posted @ 2018-10-22 13:00 TMatrix52 阅读(134) 评论(0) 推荐(0) 编辑

tofile和fromfile数组内建函数
摘要:numpy教程:基本输入输出和文件输入输出Input and output 使用数组的方法函数tofile可以方便地将数组中数据以二进制的格式写进文件。tofile输出的数据没有格式,因此用numpy.fromfile读回来的时候需要自己格式化数据 Note: 1. 读入的时候设置正确的dtype和 阅读全文

posted @ 2018-09-18 16:52 TMatrix52 阅读(538) 评论(0) 推荐(0) 编辑

python defaultdict 类型
摘要:http://www.cnblogs.com/youxin/p/3153462.html 阅读全文

posted @ 2018-05-22 16:55 TMatrix52 阅读(88) 评论(0) 推荐(0) 编辑

python time 时间处理
摘要:a='2018-03-26 17:20:11' >>> print time.strftime("%Y%m%d", a)Traceback (most recent call last): File "<stdin>", line 1, in <module>TypeError: argument 阅读全文

posted @ 2018-05-17 20:33 TMatrix52 阅读(192) 评论(0) 推荐(0) 编辑

Python: locals() 和globals()
摘要:https://www.cnblogs.com/wanxsb/archive/2013/05/07/3064783.html 阅读全文

posted @ 2018-04-23 13:29 TMatrix52 阅读(105) 评论(0) 推荐(0) 编辑

python import 其他 package的模块
摘要:https://blog.csdn.net/luo123n/article/details/49849649 http://blog.habnab.it/blog/2013/07/21/python-packages-and-you/ demo project 本文以一个demo project为例 阅读全文

posted @ 2018-03-28 20:00 TMatrix52 阅读(205) 评论(0) 推荐(0) 编辑

带列表写入文件出错先 json.dumps
摘要:output = json.dumps(output, ensure_ascii=False).encode('utf-8') 阅读全文

posted @ 2017-12-29 19:24 TMatrix52 阅读(174) 评论(0) 推荐(0) 编辑

tarfile — Read and write tar archive files
摘要:参考: https://docs.python.org/2/library/tarfile.html http://www.jianshu.com/p/bbad16822eab #解压文件tarfile.open(filepath, 'r:gz').extractall(inception_pret 阅读全文

posted @ 2017-12-10 17:16 TMatrix52 阅读(138) 评论(0) 推荐(0) 编辑

一些稍微复杂的正则表达式
摘要:参考: http://www.jb51.net/shouce/jquery/regexp.html http://www.cnblogs.com/huxi/archive/2010/07/04/1771073.html 1. 数量词的贪婪模式与非贪婪模式 2. 数量词的贪婪模式与非贪婪模式 正则表达 阅读全文

posted @ 2017-12-08 13:31 TMatrix52 阅读(218) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示