operator_itemgetter函数
来源:互联网 发布:死亡岛有网络怎么联机 编辑:程序博客网 时间:2024/06/16 11:45
operator_itemgetter()函数
operator的itemgetter()函数是一个内建函数,用于获取对象的哪些维的数据,参数为一些序号(即需要获取的数据在对象中的序号)
>>> a = [1,2,3]>>> b = operator.itemgetter(1)>>> b<operator.itemgetter object at 0x038AD830>>>> b(a)2
注意,operator.itemgetter()获取的不是值,而是定义了一个函数,通过该函数作用到对数上才能获取值
阅读全文
0 0
- operator_itemgetter函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 基数排序
- numpy_tile_function
- MyBatis整合ehcache
- BlueROV-12: Install Raspbian and ssh Connection
- 渗透与入侵2-pstools
- operator_itemgetter函数
- 《Ray Tracing in One Weekend》——Chapter 0: Overview
- 解决WebView不支持input type=file
- python_sorted函数
- 『ORACLE』 表空间属性(11g)
- SymPy使用教程
- 虚拟机类加载机制(ClassLoader)
- 安装虚拟机出现“正在进行简易安装时,无法手动启动vmware tools"以及出现解压vmware tools时,Read-only file system
- [伸展树]codevs1286 郁闷的出纳员