随笔分类 -  python

摘要:1、数组过滤,只适用于numpyalpha[alpha>0]:返回alpha中大于0的元素组成的数组2、在范围内选取不等于某值的数值j = iwhile j==i: j = int(random.uniform(0,m))3、apply(func, args)这个函数可以间接的调用函数,fun... 阅读全文
posted @ 2015-07-27 19:58 风痕影默 阅读(215) 评论(0) 推荐(0)
摘要:ValueError: invalid literal for int() with base 10: ''不能将非数字字符串转换为整型object has no attribute 对象调用一个没有的方法(内建或自定义)TypeError: only length-1 arrays can be ... 阅读全文
posted @ 2015-06-16 11:20 风痕影默 阅读(879) 评论(0) 推荐(0)
摘要:(1)read是将整个文件读入内存,将整个文件的内容当作一个字符串(2)readline是一行一行的读如内存,每一次读的一行为一个字符串(3)readlines是一次将整个文件读入内存,但是将整个文件内容当作一个列表,每一行以字符串形式当作列表的一个元素 阅读全文
posted @ 2015-06-11 16:08 风痕影默 阅读(350) 评论(0) 推荐(0)
摘要:(1) variable = a if exper else b(2)variable = (exper and [b] or [c])[0](2) variable = exper and b or c 阅读全文
posted @ 2015-06-11 16:05 风痕影默 阅读(619) 评论(0) 推荐(0)

友情链接:极限BT