摘要: import numpy as np s=np.array([[1,2,3],[4,5,6]],np.int32)#相当于list的嵌套 s.shape#数据的分布状况 s.dtype#数据类型 type(s)#s的类型 s[0]#取出第一行或者任意行 s[:,0]#取任意列 s[0,1]#取出任意 阅读全文
posted @ 2018-07-03 18:47 The_Chain 阅读(153) 评论(0) 推荐(0) 编辑
摘要: import math math.pi #圆周率 math.e #指数 math.sin(2*math.pi/180)#正弦函数 math.sqrt()#平方根求解 math.log(值,底数)#求解对数 math.exp()#求解指数函数 阅读全文
posted @ 2018-07-03 15:31 The_Chain 阅读(117) 评论(0) 推荐(0) 编辑
摘要: d={'name':'chain','age':19,'gender':'female'}#创建字典 按照 键:值 的格式创建 d['name']#按照键来取值 d['age']+=1 #给年龄加1 d={'boss':{'fristname':'xiong','age':54},'manger': 阅读全文
posted @ 2018-07-03 15:16 The_Chain 阅读(120) 评论(0) 推荐(0) 编辑
摘要: l=['ab','acv','ad']#创建列表 len(l) #列表元素个数 l[0]#取出第一个元素 l[:-1]#取出除最后一个的元素 l[0:2]#取出的数据是左开右闭区间 l[0].upper()#大写 l[1].lower()#小写 l[0].capitalize()#首字母大写 l[0 阅读全文
posted @ 2018-07-03 14:18 The_Chain 阅读(225) 评论(0) 推荐(0) 编辑