随笔分类 -  Python

摘要:ubuntu环境: Ctrl Alt 斜杠 代码整理 Ctrl D 复制当前行 Ctrl Y 删除当前行 Shift + Enter 新建一行 Ctrl+Win+加号 展开函数 Ctrl+Win+减号 折叠函数 Ctrl+Shift+Win+加号 展开所有函数 Ctrl+Shift+Win+减号 折 阅读全文
posted @ 2017-06-26 17:36 Shiyu_Huang 阅读(499) 评论(0) 推荐(0) 编辑
摘要:image_pylib模块:https://github.com/huangshiyu13/image_pylib data_engine模块:https://github.com/huangshiyu13/RPNplus/blob/master/data_engine.py _init_paths 阅读全文
posted @ 2017-06-20 10:58 Shiyu_Huang 阅读(1060) 评论(0) 推荐(0) 编辑
摘要:如下所示: 结果: 以MNIST为例,先做PCA降到50维,再做t-sne: 结果如下: 更多降维的可视化参考:http://scikit-learn.org/stable/auto_examples/manifold/plot_lle_digits.html#sphx-glr-auto-examp 阅读全文
posted @ 2017-06-05 15:38 Shiyu_Huang 阅读(16633) 评论(1) 推荐(0) 编辑
摘要:itemindex = numpy.where(array==item) 阅读全文
posted @ 2017-06-05 14:42 Shiyu_Huang 阅读(4099) 评论(0) 推荐(0) 编辑
摘要:例子: import random c = list(zip(a, b)) random.shuffle(c) a[:], b[:] = zip(*c) 阅读全文
posted @ 2017-05-29 12:48 Shiyu_Huang 阅读(3536) 评论(0) 推荐(0) 编辑
摘要:1.秒级 2.微秒级 阅读全文
posted @ 2017-05-26 15:45 Shiyu_Huang 阅读(3894) 评论(0) 推荐(0) 编辑
摘要:1.匹配对应的字符串: 阅读全文
posted @ 2017-05-26 13:05 Shiyu_Huang 阅读(241) 评论(0) 推荐(0) 编辑
摘要:该程序会每隔至少1秒进行一次护照状态查询 需要修改passportNo变量为自己的护照号码。 另外需要pip install beautifulsoup4 阅读全文
posted @ 2017-05-19 15:13 Shiyu_Huang 阅读(3474) 评论(0) 推荐(0) 编辑
摘要:1.next http://www.cnblogs.com/sesshoumaru/p/6037922.html 2.getattr getattr(x, 'y') is equivalent to x.y 阅读全文
posted @ 2017-05-10 16:59 Shiyu_Huang 阅读(126) 评论(0) 推荐(0) 编辑
摘要:import os def fileAppend(filename): myfile = open(filename,'a') myfile.write("####&&&&") myfile.close if __name__ == '__main__': filename = 'test.rmvb' fileAppend(filename) ... 阅读全文
posted @ 2017-05-08 09:52 Shiyu_Huang 阅读(3346) 评论(0) 推荐(0) 编辑
摘要:最近比较喜欢的一个并行实现,可以实时查看结果: from concurrent.futures import ProcessPoolExecutor, as_completed executor = ProcessPoolExecutor(max_workers=5) tasks = [execut 阅读全文
posted @ 2017-04-24 11:17 Shiyu_Huang 阅读(228) 评论(0) 推荐(0) 编辑
摘要:def myprint(v): print v print type(v) try: print v.shape except: try: print len(v) except: pass 阅读全文
posted @ 2017-04-10 11:37 Shiyu_Huang 阅读(1293) 评论(0) 推荐(0) 编辑
摘要:转自:https://www.douban.com/note/518335786/?type=like 改变数组的维度 已知reshape函数可以有一维数组形成多维数组ravel函数可以展平数组b.ravel()flatten()函数也可以实现同样的功能区别:ravel只提供视图view,而flat 阅读全文
posted @ 2017-04-06 12:09 Shiyu_Huang 阅读(84420) 评论(0) 推荐(2) 编辑
摘要:参考:http://www.guokr.com/post/317472/ 阅读全文
posted @ 2017-03-27 13:14 Shiyu_Huang 阅读(166) 评论(0) 推荐(0) 编辑
摘要:install: official examples: https://seaborn.pydata.org/examples/index.html 在mac上的bug: 在mac上运行会出现warnings.warn("tight_layout : falling back to Agg rend 阅读全文
posted @ 2017-03-25 18:44 Shiyu_Huang 阅读(1026) 评论(0) 推荐(0) 编辑
摘要:official document: http://pandas.pydata.org/pandas-docs/stable/10min.html 基本数据结构:http://www.open-open.com/lib/view/open1402477162868.html 绘图文档:http:// 阅读全文
posted @ 2017-03-25 17:40 Shiyu_Huang 阅读(283) 评论(0) 推荐(0) 编辑
摘要:import os.path as osp import sys def add_path(path): if path not in sys.path: sys.path.insert(0, path) this_dir = osp.dirname(__file__) path1 = osp.join(this_dir, '..', 'DATA') add_pat... 阅读全文
posted @ 2017-01-17 15:29 Shiyu_Huang 阅读(2212) 评论(0) 推荐(0) 编辑
摘要:import os import shutil from PIL import Image def getAllFiles(dirName, houzhui=' '): results = [] for file in os.listdir(dirName): file_path = os.path.join(dirName, file) if... 阅读全文
posted @ 2017-01-13 15:13 Shiyu_Huang 阅读(1439) 评论(0) 推荐(0) 编辑
摘要:加载本地json: 阅读全文
posted @ 2016-12-31 20:08 Shiyu_Huang 阅读(180) 评论(0) 推荐(0) 编辑
摘要:import numpy as np list = range(3) # 0 1 2 np.random.shuffle(list)#2 1 3,打乱了list 产生一个随机整数: 阅读全文
posted @ 2016-10-26 20:08 Shiyu_Huang 阅读(441) 评论(0) 推荐(0) 编辑

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