随笔分类 -  Python

摘要:1. 安装pyinstaller pip install pyinstaller 2.如果有外部依赖包 将外部依赖包放到你的python安装的site-packages D:\Python27\Lib\site-packages 3.直接在命令提示符中输入pyinstaller -F 文件名.py 阅读全文
posted @ 2017-07-13 16:25 fionaplanet 阅读(586) 评论(0) 推荐(0)
摘要:1.Python连接mysql数据库,并且传递参数 2.Python2存在中文打印时候的显示问题,在网上找了半天都没有解决,原来就只是需要,逐个元素的打印,不能打印list或者tuple 阅读全文
posted @ 2017-04-06 17:29 fionaplanet 阅读(549) 评论(0) 推荐(0)
摘要:重点参考三个网站: https://www.ibm.com/developerworks/community/blogs/jfp/entry/Installing_XGBoost_For_Anaconda_on_Windows?lang=zh http://www.cnblogs.com/cutd/ 阅读全文
posted @ 2017-01-17 15:36 fionaplanet 阅读(1118) 评论(0) 推荐(0)
摘要:python种距离计算包括两种方式,一是用scipy.spatial.distance里面包括的距离很多 [‘braycurtis’, ‘canberra’, ‘chebyshev’, ‘correlation’, ‘dice’, ‘hamming’, ‘jaccard’, ‘kulsinski’, 阅读全文
posted @ 2016-12-26 23:14 fionaplanet 阅读(1345) 评论(0) 推荐(0)
摘要:1.安装graphviz。下载地址在:http://www.graphviz.org/。如果你是linux,可以用apt-get或者yum的方法安装。如果是windows,就在官网下载msi文件安装。无论是linux还是windows,装完后都要设置环境变量,将graphviz的bin目录加到PAT 阅读全文
posted @ 2016-12-21 10:50 fionaplanet 阅读(12412) 评论(2) 推荐(1)
摘要:1.\d 代表任意一个数字 \D代表任意字母 \s 表示所有长得像空格的东西,包括换行 2.\w 代表数字,字母和下划线 3. *匹配前一个字符0或者无限次 (贪婪字符,但凡有就要一直去下去,?是有节制的) .匹配除换行符以外的所有字符 g全局匹配 4. [] 自定义正则化,每个字母代表一个值 [^ 阅读全文
posted @ 2016-11-19 16:41 fionaplanet 阅读(524) 评论(0) 推荐(0)
摘要:#exercise1print "Hello world!"print "Hello Again"print "I like typing this."print "this is fun."print 'Yay! Printing.'print "I'd much rather you 'not' 阅读全文
posted @ 2016-08-19 20:43 fionaplanet 阅读(436) 评论(0) 推荐(0)
摘要:#查找index函数的帮助 help(str.index) #for循环和break语句from math import sqrtfor i in range(2,101): flag=1 k=int(sqrt(i)) for j in range(2,k+1): if i%j==0: flag=0 阅读全文
posted @ 2016-08-17 23:34 fionaplanet 阅读(16785) 评论(0) 推荐(0)