![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
全杰cc
不安分的编程人员一枚
展开
-
python数据分析
numpyndarrayndarray的创建数组间的算术运算pandas的使用numpy参考文档:简书np.random.rand(3,4)#产生一个3行4列的矩阵(0-1之间的)ndarrayndarray的创建In [32]: data1=[1,2,3,4.0] In [34]: arr1 = np.array(data1)In [35]: arr1 Out[35]: array([原创 2016-05-26 15:18:53 · 369 阅读 · 0 评论 -
ipython安装
1准备环境2安装Ipython1、准备环境yum groupinstall 'Development Tools'yum install python3-devel2、安装Ipythonpip install jupyter原创 2016-08-09 16:17:06 · 270 阅读 · 0 评论 -
win7 X 64 tensorflow安装
环境说明具体安装步骤anaconda安装python35虚拟环境的设置conda create -n tensorflow python35特别说明tensorflow安装检验是否安装成功anaconda常用方法小结conda create -n tensorflow python35创建环境并指定python的版本号conda remove -n tensorflow all删除原创 2017-06-02 19:36:53 · 484 阅读 · 0 评论 -
django rest framework and angularjs
123451pip install -r requirements.txtpython setup.py develop2sudo apt-get install npm3sudo npm install -g expressnpm install -g grunt-cli bower4npm installbower insta原创 2016-12-27 14:19:08 · 721 阅读 · 0 评论 -
python2和3使用过程中的(重要)不同点记录
除法 - - - dict的iter除法 - - - > /python2: 3/2=1 python3:3/2=1.5dict的iterpython2: Hs.iteritems() python3:Hs.items()原创 2016-12-25 17:16:37 · 288 阅读 · 0 评论 -
requests应用step1
爬取说明使用模块主要作用说明代码解释完整代码爬取说明爬取的是小黄鸭的图片并保存到本地使用模块主要作用说明import requestsfrom urllib.request import urlretrieveimport reimport osurlretrieve:保存下载的图片 os:判断文件目录是否存在和文件目录的创建 re:正则模块,查找需要的内容代码解释设置了请求头:u原创 2016-09-05 17:20:40 · 268 阅读 · 0 评论 -
python爬虫总结
基础基础原创 2016-09-04 21:05:14 · 347 阅读 · 0 评论 -
selenium结合lxml爬取豆瓣电影相关信息
环境说明重要代码解释完整代码环境说明python3.5 centos7.2重要代码解释使用selenium加载网页:driver=webdriver.PhantomJS()driver.get("https://movie.douban.com/")使用selenium和web进行互动将网页加在完全:end = Truewhile (end): try: end原创 2016-09-04 21:02:52 · 981 阅读 · 0 评论 -
python使用中的错误总结
pip使用错误python中使用scrapy的错误python环境使用说明: centos7 python3.5.2pip使用错误错误描述:command 'gcc' failed with exit status 1解决办法:yum -y install gcc gcc-c++ kernel-devel yum -y install python-devel libxslt-devel原创 2016-08-07 23:30:24 · 411 阅读 · 4 评论 -
pyspider
安装安装(1)、加如下的path到环境变量中export PYCURL_SSL_LIBRARY=nss(2)、使用pip安装pip install pyspider(3)、在浏览器中检查localhost:5000原创 2016-08-16 09:47:21 · 283 阅读 · 0 评论 -
centos7下安装python3
安装前的准备工作安装一些环境将usrbinpython重命名修改usrbinyum安装python3将下载好的python3压缩包解压进入解压目录添加python快捷图标安装前的准备工作安装一些环境yum install openssl-devel将/usr/bin/python重命名[root@]#cd /usr/bin/[root@]#ls python*python py原创 2016-07-17 15:55:38 · 1470 阅读 · 0 评论 -
python相关
os列出一个目录下的所有目录包括文件os列出一个目录下的所有目录(包括文件)#!/usr/bin/pythonimport ospwd = os.path.abspath('.')[0]global aa=1def findName(path,name): global a print(a,path,os.path.isdir(path),path.__contains__(n原创 2016-07-11 17:16:00 · 227 阅读 · 0 评论 -
python 数据清理诺干错误
re问题nltk问题re问题1、错误描述: TypeError: expected string or buffer TypeError: can't use a string pattern on a bytes-like object解决办法: str(urlopen("http://pythonscraping.com/files/inaugurationSp原创 2016-06-04 20:06:32 · 808 阅读 · 0 评论 -
python_mysql
MySQLdb安装问题MySQLdb安装问题问题描述: Could not find a version that satisfies the requirement MySQLdb (from versions: )No matching distribution found for MySQLdb还有可能是下面的错误:error: command 'gcc' failed with exi原创 2016-04-19 21:41:06 · 481 阅读 · 0 评论 -
python编码问题
错误一错误二错误一错误描述:UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe5 in position 0: ordinal not in range(128) 错误原因:原因就是Python的str默认是ascii编码,和unicode编码冲突。 解决方法:import sysreload(sys)sys.setdefault原创 2017-07-31 15:58:28 · 212 阅读 · 0 评论