![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
yxpandjay
这个作者很懒,什么都没留下…
展开
-
python print报UnicodeDecodeError: ‘ascii‘ codec can‘t decode XX
sudo apt install language-pack-zh-hans执行export LC_ALL=en_US.UTF-8参考:https://cloud.tencent.com/developer/article/1543268https://www.cnblogs.com/jokerBi/p/10812804.html原创 2021-04-26 16:44:55 · 145 阅读 · 0 评论 -
python安装pip
安装部分依赖apt-get install python3-distutils先安装setuptoolswget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6.tar.gztar -zxvfsetuptools-19.6.tar.gzcdsetuptools-19.6python3 setup.py buildpython3 se...原创 2021-03-29 16:34:11 · 133 阅读 · 0 评论 -
ubuntu上自编译python3.6
#先安装openssl dev:aptinstallopensslaptinstalllibssl-dev#下载并解压python包:tar -zxvf Python-3.6.10.tgzcd Python-3.6.10./configure --with-sslsudo makesudo make install# 创建软连接,先查看python3.6.10的安装路径which python3 #/usr/local/bin/python3sudo l...原创 2020-09-24 11:15:55 · 297 阅读 · 0 评论 -
Numpy广播机制
先看一个例子:a.shape = ( m , 2)b.shape = (n , 1 , 2 )c = np.minimum(a,b) 是什么形状呢? 答案是 ( n , m ,2 )参考:https://www.cnblogs.com/jiaxin359/p/9021726.html#_label1_0原创 2020-09-15 01:10:04 · 104 阅读 · 0 评论 -
Sublime3 配置 anaconda环境
作者:青草腥链接:https://www.zhihu.com/question/27290549/answer/420293275来源:知乎著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。找到你需要的环境的路径:2. 在Sublime新建build system,编辑.sublime-build文件 :{ "cmd": ["/path/to/python", "-u", "$file"], "file_regex": "^[ ]*File \.原创 2020-09-08 10:36:17 · 450 阅读 · 2 评论 -
matplotlib中ion()和ioff()的使用以及画动态图
介绍在使用matplotlib的过程中,发现不能像matlab一样同时开几个窗口进行比较,于是查询得知了交互模式,但是放在脚本里运行的适合却总是一闪而过,图像并不停留,遂仔细阅读和理解了一下文档,记下解决办法,问题比较简单,仅供菜鸟参考。python可视化库matplotlib有两种显示模式:阻塞(block)模式交互(interactive)模式在Python Consol命令行中,默认是交互模...转载 2018-07-11 11:37:59 · 1431 阅读 · 0 评论 -
Matplotlib系列---pyplot的plot( )函数
Matplotlib系列—pyplot的plot( )函数plt.plot(x,y,format_string,**kwargs) 说明:x:x轴数据,列表或数组,可选 y:y轴数据,列表或数组 format_string:控制曲线的格式字符串,可选 **kwargs:第二组或更多,(x,y,format_string)注:当绘制多条曲线时,各条曲线的x不能省略 例子:i...转载 2018-08-17 14:46:16 · 2757 阅读 · 1 评论 -
python之曲线拟合
https://blog.csdn.net/your_answer/article/details/79195428https://blog.csdn.net/guduruyu/article/details/70313176https://blog.csdn.net/yefengzhichen/article/details/52767733https://blog.csdn.net...原创 2018-08-17 14:58:23 · 3589 阅读 · 0 评论 -
Python绘图精简实例附代码
https://blog.csdn.net/golden1314521/article/details/44700551#10-%E7%AE%B1%E7%BA%BF%E5%9B%BE转载 2018-08-17 15:49:26 · 8994 阅读 · 0 评论 -
python的维度问题及链表推导式
链表推导式:https://blog.csdn.net/zhangfeng1133/article/details/51497534原创 2019-02-20 11:24:27 · 167 阅读 · 0 评论 -
Python装饰器
https://www.cnblogs.com/yueshangzuo/p/8744334.html转载 2019-06-21 09:53:52 · 77 阅读 · 0 评论 -
numpy和keras的resize顺序问题
先看实验代码:import numpy as npfrom keras.models import Sequentialfrom keras.layers import Reshapedef GetModel(): model = Sequential() model.add(Reshape( (-1,), input_shape=(2,3,4))) retu...原创 2019-08-13 09:38:03 · 1046 阅读 · 0 评论 -
Python异步IO库asyncio 协程 学习笔记
asyncio是Python 3.4版本引入的标准库,直接内置了对异步IO的支持。import asyncio@asyncio.coroutinedef hello(): print("Hello world!") # 异步调用asyncio.sleep(1): r = yield from asyncio.sleep(1) print("Hello a...原创 2019-09-10 11:28:31 · 215 阅读 · 0 评论 -
Python pip用国内镜像下载的办法及import cv2
原文地址:http://blog.csdn.net/u010536377/article/details/50564185一直想在Ubuntu安装opencv,结果各种出错,现在有一个最简单的办法: sudo pip install --index https://pypi.mirrors.ustc.edu.cn/simple/ opencv-contrib-python问题搞定。尤其是提示了问题...转载 2018-07-11 11:19:06 · 4853 阅读 · 0 评论 -
Python 函数中,参数是传值,还是传引用?
转自:http://python.jobbole.com/87801/原文出处: liuzhijun 在 C/C++ 中,传值和传引用是函数参数传递的两种方式,在Python中参数是如何传递的?回答这个问题前,不如先来看两段代码。代码段1:Pythondef foo(arg): arg = 2 print(arg)a = 1foo(a) # 输出:2print(a) ...转载 2018-06-10 02:04:46 · 190 阅读 · 0 评论 -
Python入门相关(一)
input()函数返回的是字符串可配合eval()函数使用。eval()为去掉最外侧的引号对(""和'')print函数为默认换行的,如果不想让其换行可以设置end例子: print("HAHA",end='') print('接着上面呦')输出: HAHA接着上面呦...原创 2018-05-26 15:51:03 · 544 阅读 · 1 评论 -
Python正则表达式相关
原创 2018-06-02 17:49:40 · 133 阅读 · 0 评论 -
Python入门相关(二)
也就是说可以不用seed,直接调用random(),此时种子为系统时间 代码一行写不下,可以用\换行蒙特卡洛方法计算PI出现词频分析:原创 2018-05-27 21:15:30 · 139 阅读 · 0 评论 -
Python 科学计算和绘图
转自:http://python.jobbole.com/87471/原文出处:達聞西给深度学习入门者的Python快速教程基础篇numpy和Matplotlib篇本篇部分代码的下载地址:https://github.com/frombeijingwithlove/dlcv_for_beginners/tree/master/chap55.3 Python的科学计算包 – Numpynum...原创 2018-05-23 11:50:37 · 13874 阅读 · 2 评论 -
Python入门相关(三)
方法二这种用法,默认每次读入一行map(f,x)函数:内置函数,让f函数作用于x中的每个函数原创 2018-05-28 22:08:30 · 149 阅读 · 0 评论 -
Python安装whl文件
看了好多博客,都要添加PATH路径,很麻烦,这里给出一种方法:把whl文件放C盘,比如我要安装的文件叫numpy-1.14.3+mkl.....amd64.whl 然后原创 2018-06-11 23:18:49 · 555 阅读 · 0 评论 -
Python中*和**
数学运算中, *为乘,**为次方当要使函数接收元组或字典形式的参数 的时候,有一种特殊的方法,它分别使用*和**前缀 。这种方法在函数需要获取可变数量的参数 的时候特别有用。[注意] [1] 由于在args变量前有*前缀 ,所有多余的函数参数都会作为一个元组存储在args中 。如果使用的是**前缀 ,多余的参数则会被认为是一个字典的健/值对 。[2] 对于def func(*args):,*arg...转载 2018-05-24 19:48:53 · 11570 阅读 · 0 评论 -
Python open文件操作
转自:https://blog.csdn.net/c369624808/article/details/79039311Python open() 函数 python open() 函数用于打开一个文件,创建一个 file 对象,相关的方法才可以调用它进行读写。函数语法open(name[, mode[, buffering]])1参数说明:name : 一个包含了你要访问的文件名称的字符串值。...转载 2018-05-24 20:06:46 · 424 阅读 · 0 评论 -
Python可视化相关(1)
IVTK可用来观察管线原创 2018-05-29 23:59:42 · 317 阅读 · 0 评论 -
Scpy入门
生成爬虫:原创 2018-06-02 14:38:16 · 1330 阅读 · 0 评论 -
Python海龟绘图
#yezi.pyimport turtle#窗口位置函数setup(width,height[,startx,starty]) turtle.setup(850,450,300,300) #拿起海龟,此时画不出线条turtle.penup()#前进-350距离turtle.fd(-350)#向左,右转45度turtle.left(45)turtle.right(45)#后退-...原创 2018-05-26 15:43:11 · 2619 阅读 · 0 评论