
python
文章平均质量分 89
taoyuanforrest
这个作者很懒,什么都没留下…
展开
-
使用setuptools自动安装python模块
转自http://blog.youkuaiyun.com/cnbird2008/article/details/4388280setuptools绝对是个好东西,它可以自动的安装模块,只需要你提供给它一个模块名字就可以了,并且自动帮你解决模块的依赖问题。一般情况下用setuptools给安装的模块会自动放到一个后缀是.egg的目录里,下面看看怎么用setuptools。 首先,需要安装s转载 2013-10-25 18:55:23 · 1055 阅读 · 0 评论 -
python性能分析工具
1)cProfilecProfile可以嵌入到python代码中执行,比如:import cProfilecProfile.run('foo()', 'foo.out')查看结果需要pstats模块,比如:import pstatsp = pstats.Stats('foo.out')p.print_stats()pstats还可以排序, 以及打印排名靠前的记录。比如...原创 2019-03-06 09:56:58 · 3175 阅读 · 0 评论 -
python debug
1) logging模块2)打印当前调用堆栈(非Exception堆栈)import inspectprint inspect.stack()3)打印exception异常堆栈traceback原创 2019-03-05 15:23:16 · 1334 阅读 · 0 评论 -
Python3.5安装tkinter
系统环境:CentOS 6.7 64bit1) yum -y install tkinter tcl-devel tk-devel安装完以后的库以及头文件为:[root@localhost lib]# ll /usr/lib64/libtk*lrwxrwxrwx. 1 root root 11 Dec 12 06:28 /usr/lib64/libtk.so -> l...原创 2018-12-12 14:57:36 · 3976 阅读 · 0 评论 -
scikit-learn常用接口
1)roc_auc_score 获取AUC score用法:from sklearn import metricsauc = metrics.roc_auc_score(y_true, y_score)常见问题:Data is not binary and pos_label is not specified原因:y_true必须是0 1 array,如果不是0,1可以有两种...原创 2018-10-27 10:45:21 · 732 阅读 · 0 评论 -
超参选择之Grid Search
Grid Search原创 2018-10-28 18:51:13 · 809 阅读 · 0 评论 -
超参选择之BayesianOptimization
python hyperopt原创 2018-10-28 18:36:02 · 1475 阅读 · 0 评论 -
jupyter安装配置(Virtualbox运行)
python3 -m pip install --upgrade pippython3 -m pip install jupyter运行:jupyter notebook如果jupyter是运行在virtualbox虚拟机里面,那么可以设置virtualbox允许主机访问:由于virtualbox设置成了NAT网络连接,因此需要通过端口转发的方式,允许宿主机器访问。jupyter...原创 2018-10-19 14:55:14 · 3167 阅读 · 0 评论 -
auto-sklearn安装配置
官方安装指南:http://automl.github.io/auto-sklearn/stable/installation.html#installation系统需求:auto-sklearn has the following system requirements:Linux operating system (for example Ubuntu), Python (&...原创 2018-10-19 10:53:54 · 6068 阅读 · 2 评论 -
安装setuptools+pip
1) 安装setuptoolswget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gztar zxvf setuptools-0.6c11.tar.gzcd setuptools-0.6c11python setup.py buildpython setup.py instal原创 2017-04-27 17:24:41 · 430 阅读 · 0 评论 -
python not found in the registry
实测python3.5可用from __future__ import print_function import sys try: from winreg import *except ImportError: from _winreg import * # tweak as necessaryversion = sys.version[:3]转载 2016-11-18 09:18:54 · 958 阅读 · 0 评论 -
python遍历删除指定后缀文件
#!/usr/bin/pythonimport osfor root , dirs, files in os.walk(r'E:\.m2\repository'): for name in files: if name.endswith(".repositories") or name.endswith(".sha1"): os.r原创 2016-05-18 10:22:19 · 3911 阅读 · 1 评论 -
pip: error: No command by the name pip list
查看当前系统的python原创 2014-11-07 10:16:39 · 2854 阅读 · 0 评论 -
python 操作windows下的目录[转]
转自http://hi.baidu.com/pythond/item/c6bc99491cfb0be9a5c066a8python操作目录、文件相关的函数,在os模块中,当然或许也有别的模块提供了更方便的函数以下列出的所有函数均亲自测试过!1、os.getcwd() os.chdir(dir) #获取当前目录 ,改变当前目录为dir2、转载 2013-11-05 08:45:08 · 1669 阅读 · 0 评论 -
时间序列分析 - python实现
python的statsmodels模块(http://www.statsmodels.org/dev/tsa.html)提供了时间序列分析相关的内容:acf() 计算自相关 statsmodels.tsa.stattools.acfplt_acf() 画自相关系数 statsmodels.graphic...原创 2019-03-13 20:01:17 · 3541 阅读 · 0 评论