科学网

 找回密码
  注册
报错runtimgWarning invalid value encountered in true_divide
高建召 2019-4-9 09:25
遇到问题 /sw/python/2.7.6/lib/python2.7/site-packages/scipy-0.14.0-py2.7-linux-x86_64.egg/scipy/stats/stats.py:2714: RuntimeWarning: invalid value encountered in true_divide t = rs * np.sqrt((n-2) / ((rs+1.0)*(1.0-rs))) /sw/python/2.7.6/lib/python2.7/site-packages/scipy-0.14.0-py2.7-li ...
个人分类: python|9602 次阅读|没有评论
PageRank 用在无向图上
热度 1 高建召 2017-4-29 15:34
参考1: http://jia1546.is-programmer.com/posts/32327.html 参考2: http://en.wikipedia.org/wiki/Pagerank 参考3: http://blog.sina.com.cn/s/blog_482da2d20102drpt.html #####1 原PageRank算法是针对有向图, 迭代方程为: , 其中 是顶点 的PageRank值, 是顶点 的出度。 对无 ...
个人分类: python|9909 次阅读|1 个评论 热度 1
python 随机产生文件名字
高建召 2016-12-30 16:17
使用 Python 随机生 文件名字 import tempfile tempfile.NamedTemporaryFile().name
个人分类: python|3212 次阅读|没有评论
python 中Wilcoxon rank-sum 和 R 中的 wilcox.test
高建召 2016-12-21 23:10
python 中Wilcoxon rank-sum 和 R 中的 wilcox.test 参考网页: http://stackoverflow.com/questions/12797658/pythons-scipy-stats-ranksums-vs-rs-wilcox-test python scipy 中的 ranksums(x,y) 相当于 R中的 wilcox.text(x,y,exact=FALSE,correct=FALSE) #### python code x= ...
个人分类: python|11158 次阅读|没有评论
得到 前n个最大的数
高建召 2016-10-23 07:50
得到前n个最大的数 参考: http://stackoverflow.com/questions/6910641/how-to-get-indices-of-n-maximum-values-in-a-numpy-array https://docs.scipy.org/doc/numpy/reference/generated/numpy.argpartition.html 可以使用numpy 中的 argpartition 函数。该函数在最坏情况下,时间复杂度为线性时间。 ...
个人分类: python|6661 次阅读|没有评论
matplotlib 标签超出画布
高建召 2016-10-3 00:48
matplotlib 标签超出画布 可在保存图片之前加入这一句: plt . tight_layout () 参考原文:http://matplotlib.org/users/tight_layout_guide.html 示例图1: To prevent this, the location of axes needs to be adjusted. For subplots, this can be done by adjusting the subplot ...
个人分类: python|8717 次阅读|没有评论

本页有 4 篇博文因作者的隐私设置或未通过审核而隐藏

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-26 03:33

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部