2015年5月19日
摘要: operator.itemgetter函数operator模块提供的itemgetter函数用于获取对象的哪些维的数据,参数为一些序号(即需要获取的数据在对象中的序号),下面看例子。a = [1,2,3]>>> b=operator.itemgetter(1) //定义函数b,获取对象的第1个域... 阅读全文
posted @ 2015-05-19 20:52 大雄fcl 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 一、Python的排序1、reversed()这个很好理解,reversed英文意思就是:adj. 颠倒的;相反的;(判决等)撤销的print list(reversed(['dream','a','have','I']))#['I', 'have', 'a', 'dream']2、让人糊涂的sor... 阅读全文
posted @ 2015-05-19 20:51 大雄fcl 阅读(1128) 评论(0) 推荐(0) 编辑
摘要: 1、array.sum()from numpy import *import operatorgroup = array([[1.0,1.1],[1.0,1.0],[0,0],[0,0.1]])print(group)print(type(group))print(group.sum(axis=0)... 阅读全文
posted @ 2015-05-19 11:02 大雄fcl 阅读(201) 评论(0) 推荐(0) 编辑