
Python
北境の守卫
Good
展开
-
【VSCode】插件 Python : Python 开发支持
Backto VS Code微软官方出品,Python 开发支持,用于将 VS Code 打造成一个轻量的 Python IDE.个人而言,已替代笨重的 PyCharm (since 2020.05.05).Tips & TricksEditing自动补全method 名字并添加括号,将光标置于括号内"python.autoComplete.addBrackets": true,Quick Fixes, 类似 np, plt 等的自动补齐 importFormatting.原创 2020-07-06 17:35:59 · 608 阅读 · 0 评论 -
【VSCode】插件 Pylance : 给 Python 带来编译语言般的开发支持
Backto VS CodePylance 是 微软在 2020.06.01 发布的一款 python 语言支持 vs code 插件。Fast, feature-rich language support for PythonPylance is an extension that works alongside Python in Visual Studio Code to provide performant language support. Under the hood, Pylanc.原创 2020-07-06 11:12:10 · 9744 阅读 · 0 评论 -
【Python】Pillow-SIMD:Pillow 加速版
Backto Python IndexSIMD 代表 single instruction, multiple data, 充分压榨多核(Intel) CPU 的性能. 常用的 CPU SIMD 指令集有MMX, SSE-SSE4, AVX, AVX2, AVX512, NEON 等。Pillow-SIMD 就是 应用 SIMD 加速的 Pillow,100% API cover, pr...原创 2020-04-30 11:24:45 · 4013 阅读 · 0 评论 -
【Python】Pillow - PIL 升级版
Backto Python IndexPIL 已经停更好多年了,只是还没有官宣 dead 而已。升级替代者就是 Pillow.老代码中看到 PIL的,就直接安装 Pillow 。API 看 官方文档原创 2020-04-30 11:03:36 · 2298 阅读 · 0 评论 -
【Python】numpy的小函数
Backto Python Index均分函数 numpy.arange() 和 numpy.linspace()前者按整数步长均分,后者份数浮点均分>> np.arange(3, 7, 2)[3 5]numpy.linspace(start, stop, num=50, endpoint=True, retstep=False)>>> np.l...原创 2019-10-18 11:34:33 · 223 阅读 · 0 评论 -
【Python】zip 函数
Backto Python Indexzip 函数是Python里面具有代表性、超好用的 built-in 函数之一。其作用就是,给定任意多个 sequence,把相同下标的元素组合成tuple,再返回。简化了一大票操作。对于Python2 中的 zip 返回的是一个 tuple 的 list。Help on built-in function zip in module __built...原创 2019-05-05 14:11:29 · 212 阅读 · 0 评论 -
【Python】scipy.misc 模块
Backto Python之前一直搞不懂 misc 的含义,后来查了官网,吐了一口老血: misc 是 miscellaneous 的缩写,杂项 的意思。代表没别的合适的地方放了,就放在这里了。官网的介绍是Miscellaneous routines (scipy.misc)Various utilities that don’t have another home.和图像io相关...原创 2019-05-05 11:42:30 · 18092 阅读 · 5 评论 -
【Python】图像处理库PIL中图像格式转换
Backto Python Index此处图像格式指的是内存中图像的格式,比如 RGB 图像,灰度图像等,而不是硬盘上存储的 png,jpg 等文件格式。不管文件格式如何,读取到内存中,都会变成 PIL 指定的格式,在 PIL 中,一共设置了 8 个格式:1,L,P,RGB,RGBA,CMYK,YCbCr,I,F。其中最常用的就是 L: 8-bit 灰度图像,RGB 24-bit 彩色...原创 2019-05-05 11:20:53 · 1584 阅读 · 0 评论 -
【Python】PIL模块之 ImageOps
Backto Python IndexImageOps 打包了一些 ready-to-use 的常用函数。比如ExpandImageOps.expand(image, border=0, fill=0)⇒ imageborder = (Left, Top, Right, Bottom) 四个方位 padding像素尺寸。fill 是 填充的图像颜色,RefPython图像处...原创 2019-05-05 11:00:15 · 1778 阅读 · 0 评论 -
【Python】函数参数 arguments
Backto Python Index##带星参数: *args, **kwargs单星号和双星号,代表 多参数的传入或变量的拆解。最初,星号变量是用在函数的参数传递上的,在下面的实例中,单个星号代表这个位置接收任意多个非关键字参数,在函数的*b位置上将其转化成元组,而双星号代表这个位置接收任意多个关键字参数,在**b位置上将其转化成字典:*: 该位置接受任意多个非关键字(non-ke...原创 2019-05-05 14:29:32 · 1743 阅读 · 0 评论 -
【Python】Six: Python 2 and 3 Compatibility Library
Backto Python IndexSix 是一个用于 smooth Python 2vs3 代码兼容性的包,名字来源 6=2×36 = 2\times36=2×3 。资源: github ⊙\odot⊙ readthedocs应用案例:原创 2019-05-08 16:49:15 · 433 阅读 · 0 评论 -
【Python】EasyDict:Make Dictionary Easier
Backto Python IndexEasyDict 可以像操作属性一样操作dict里的变量,爽的飞起。>>> from easydict import EasyDict as edict>>> d = edict({'foo':3, 'bar':{'x':1, 'y':2}})>>> d.foo3>>> d...原创 2019-04-30 16:43:52 · 403 阅读 · 0 评论 -
【Python】配置新环境
Backto Python Index原则: 使用 conda 管理多版本环境,使用 pip 安装包。Step 1: conda 环境安装conda 后,进入 conda prompt,第一步切换 conda 源. 清华源已废,用科大源。配置一次即可。conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkg...原创 2019-05-10 15:08:42 · 653 阅读 · 0 评论 -
【CV】numpy 视角下的 image
Backto Python Indexnp array to other image-formatsarr = np.random.random(3, 512, 512)to pilformatted = ((arr - np.min(arr))*255 / (np.max(arr) - np.min(arr) + 1e-0.5)).astype('uint8')img = Ima...原创 2019-07-04 14:42:20 · 212 阅读 · 0 评论 -
【Python】数据结构之集合: set()
Backto Python Index很好玩儿的数据结构,多用于无序数据去重多组数据逻辑运算,寻找交集,并集,非集等操作见https://blog.youkuaiyun.com/business122/article/details/7541486...原创 2019-07-12 11:48:33 · 293 阅读 · 0 评论 -
【Python】Python 日期时间操作包 - datetime
Backto Python Indeximport datetime# make datetime from stringstart_time = datetime.datetime.strptime("2019-08-20 14:35:25", '%Y-%m-%d %H:%M:%S')# datetime to string and printprint(start_time.st...原创 2019-09-24 16:03:43 · 995 阅读 · 0 评论 -
【Python】shutil模块: High-level file operations
Backto Python Indeximport shutil# copy file (dst could be file or dir):contentshutil.copy(src,dst)# copy file (dst could be file or dir):content and create/modify/access timeshutil.copy2(src...原创 2019-04-10 17:00:23 · 143 阅读 · 0 评论 -
【Python】os模块: Miscellaneous operating system interfaces
Backto Python Indeximport os# concatenate pathos.path.join(part1,part2,part3)# list all file/sub-dir names in the current directory given by path# not for files in sub-diros.listdir(path)#...原创 2019-04-10 15:42:30 · 215 阅读 · 0 评论 -
【Py】matplotlib 使用指南
BacktoPython Indeximportfrom matplotlib import pyplot as pltplt.switch_backend('agg')plot and saveframe = plt.gca()plt.imshow(data)#plt.colorbar() frame.axes.get_yaxis().set_visible(False)...原创 2019-03-21 18:31:42 · 233 阅读 · 0 评论 -
【Python】Python 文件操作
依赖的库文件对象操作 File Object文件内容操作 File ContentRef依赖的库osshutilpickle文件对象操作 File Object文件内容操作 File ContentRef关于python文件操作 : 罗列了 python 常用的文件操作, 方便查找, 非常完备了python 文件操作总结 : 列举了一些场景...原创 2018-09-10 21:42:09 · 405 阅读 · 0 评论 -
【Python】NumPy Overview
Backto Python Index原创 2018-09-10 22:01:07 · 211 阅读 · 0 评论 -
【Python】SciPy Overview
Backto Python Index原创 2018-09-10 22:03:14 · 166 阅读 · 0 评论 -
【Python】Scikit-learn Overview
Backto Python Index原创 2018-09-10 22:06:25 · 165 阅读 · 0 评论 -
【Python】PySpark Overview
Backto Python Index原创 2018-09-10 22:07:36 · 154 阅读 · 0 评论 -
【Python】Pandas Overview
Backto Python Index原创 2018-09-10 22:09:59 · 157 阅读 · 0 评论 -
【Python】Python Basics Overview
Backto Python Index原创 2018-09-10 22:18:36 · 186 阅读 · 0 评论 -
【Python】 Python 学习资源汇总
Backto Python IndexI. BooksII. Tutorials廖雪峰的 Python 教程, 中文,免费,零起点,完整示例,基于最新的Python 3版本 : 适合入门III. Video Classes原创 2018-09-21 10:36:39 · 523 阅读 · 0 评论 -
【Python】Python 字符串操作
隐藏在模型背后的数学原理 : 很好好系统, 动图很棒LeetCode 带思路讲解原创 2018-09-21 11:09:49 · 448 阅读 · 0 评论 -
【Python】conda使用指南
Backto Python Index.Anaconda 是一个用于科学计算的Python发行版,里面预装好了conda、某个版本的python、众多packages、科学计算工具等等,提供包管理与环境管理的功能,可以很方便地解决多版本python并存、切换以及各种第三方包安装问题。conda是一个工具,其核心功能是包管理与环境管理。包管理与pip的使用类似,环境管理则允许用户方便地安装不...原创 2019-08-05 10:41:49 · 1293 阅读 · 0 评论 -
【Python】Python2.x vs Python3.x
Backto Python IndexHistory 历史因缘常见不同2.x3.x备注print xxxprint(xxx)xrangerange原创 2019-03-14 19:15:03 · 173 阅读 · 0 评论 -
【Python】pip 使用指南
Backto Python Index常用指令# to upgrade pippython -m pip install –upgrade pippip 源国内常用的源清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/ 阿里云 http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https...原创 2019-03-15 14:13:15 · 236 阅读 · 0 评论 -
【Python】py27m vs py27mu
Backto Python Indexpy27m 和 py27mu 是两种不同的Linux发行版,它们是CPython的配置。 m是narrow-unicode(2-byte)的版本,mu是wide-unicode(4-byte)的版本。混淆了版本会提示 xxx.whl is not a supported wheel on this platform..最新的系统一般都是 mu 的。...原创 2019-03-15 15:09:59 · 931 阅读 · 0 评论 -
【Python】virtualenv 和 virtualenvwrapper
Backto Python Indexvirtualenv 用于创建虚拟环境, 而 virtualenvwrapper 用于伴生管理。使用起来,比较生硬,建议转 conda.强用的话,保重身体:创建基本环境:mkvirtualenv [环境名]删除环境:rmvirtualenv [环境名]激活环境:workon [环境名]退出环境:deactivate列出所有环境:wo...原创 2019-03-15 16:15:09 · 118 阅读 · 0 评论 -
【Py】Pandas使用指南
Backto Python IndexScenes: 存储信息到 CSV 文件import pandas as pd#任意的多组列表a = [1,2,3]b = [4,5,6] #字典中的key值即为csv中列名dataframe = pd.DataFrame({'a_name':a,'b_name':b})#将DataFrame存储为csv,index表示是否显示...原创 2019-03-21 18:12:42 · 205 阅读 · 0 评论 -
【Python】Python Index
Python 语言基础 概览 overviewNumPy 概览 overviewSciPy 概览 overviewScikit-learn 概览 overviewPySpark 概览 overviewmatplot : 可视化 概览 overview原创 2018-09-10 21:40:08 · 792 阅读 · 0 评论