摘要: class People: def __init__(self,name): self.name=name def talk(self): print ("i'm {}".format(self.name)) class Student(People): def talk(self): People.talk(self) ... 阅读全文
posted @ 2018-07-24 15:33 luozx207 阅读(164) 评论(0) 推荐(0) 编辑
摘要: #字典的遍历方式 dic={"a":1,"b":2,"c":3} for k in dic: print (k,dic[k]) for k,v in dic.items():#dic.iteritems()不再存在 print (k,v) #字典的合并方法 #dic.items()的类型是dict.items,不再能相加 #dic3=dic(dic1,**dic2)也不能使用 d... 阅读全文
posted @ 2018-07-24 11:52 luozx207 阅读(4434) 评论(0) 推荐(0) 编辑
摘要: 一、numpy 1、numpy中所有元素必须是相同的类型 2、创建:np.array(collection) 3、ndarray的属性:ndim(维度个数)、shape(维度大小)、dtype(数据类型) 4、np.zeros():全零;np.ones():全1 ;np.empty(): 内存里的随 阅读全文
posted @ 2018-07-24 11:29 luozx207 阅读(388) 评论(0) 推荐(0) 编辑