![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
xjywt123
这个作者很懒,什么都没留下…
展开
-
Python array
array([(1,2),(3,4)]) misuse of [] and()原创 2016-03-04 10:32:05 · 308 阅读 · 0 评论 -
Python argsort()
[4,5,1]中,‘4’的索引是0,‘5’的索引是1,‘1’的索引是2。从小到大排列,就是1、4、5,对应索引就是2、0、1PS:argsort函数返回的是:数组值从小到大的索引值原创 2016-03-04 18:19:07 · 658 阅读 · 0 评论 -
python中xrange用法
>>> x=xrange(0,8)>>> printxxrange(8)>>> printx[0]0>>> printx[7]7>>> printx[8]Traceback (most recent call last): File"", line 1,in IndexError: xrange objectindex out转载 2016-03-04 19:43:13 · 627 阅读 · 0 评论 -
python list and tuple
listPython内置的一种数据类型是列表:list。list是一种有序的集合,可以随时添加和删除其中的元素。比如,列出班里所有同学的名字,就可以用一个list表示:>>> classmates = ['Michael', 'Bob', 'Tracy']>>> classmates['Michael', 'Bob', 'Tracy']变量classmates就是一个list转载 2016-03-05 08:59:05 · 187 阅读 · 0 评论 -
The analysis of decorator in Python
本文实例讲述了Python装饰器decorator用法。分享给大家供大家参考。具体分析如下:1. 闭包(closure)闭包是Python所支持的一种特性,它让在非global scope定义的函数可以引用其外围空间中的变量,这些外围空间中被引用的变量叫做这个函数的环境变量。环境变量和这个非全局函数一起构成了闭包。复制代码 代码如下:def outer(x): y =转载 2016-04-09 08:29:00 · 190 阅读 · 0 评论