摘要:https://juejin.im/post/5c07b27af265da611b58234c multiprocessing.Process multiprocessing.Queue
阅读全文
摘要: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
阅读全文
摘要:https://www.cnblogs.com/herbert/archive/2013/01/09/2852843.html
阅读全文
摘要: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))))
阅读全文
摘要:注意,默认的heap是一个小顶堆! heapq模块提供了如下几个函数: heapq.heappush(heap, item) 把item添加到heap中(heap是一个列表) heapq.heappop(heap) 把堆顶元素弹出,返回的就是堆顶 heapq.heappushpop(heap, it
阅读全文
摘要:numpy教程:基本输入输出和文件输入输出Input and output 使用数组的方法函数tofile可以方便地将数组中数据以二进制的格式写进文件。tofile输出的数据没有格式,因此用numpy.fromfile读回来的时候需要自己格式化数据 Note: 1. 读入的时候设置正确的dtype和
阅读全文
摘要:http://www.cnblogs.com/youxin/p/3153462.html
阅读全文
摘要: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
阅读全文
摘要:https://www.cnblogs.com/wanxsb/archive/2013/05/07/3064783.html
阅读全文
摘要:https://blog.csdn.net/luo123n/article/details/49849649 http://blog.habnab.it/blog/2013/07/21/python-packages-and-you/ demo project 本文以一个demo project为例
阅读全文
摘要:output = json.dumps(output, ensure_ascii=False).encode('utf-8')
阅读全文
摘要:参考: https://docs.python.org/2/library/tarfile.html http://www.jianshu.com/p/bbad16822eab #解压文件tarfile.open(filepath, 'r:gz').extractall(inception_pret
阅读全文
摘要:参考: http://www.jb51.net/shouce/jquery/regexp.html http://www.cnblogs.com/huxi/archive/2010/07/04/1771073.html 1. 数量词的贪婪模式与非贪婪模式 2. 数量词的贪婪模式与非贪婪模式 正则表达
阅读全文