摘要: plt.legend((u'头等舱', u'2等舱', u'3等舱'), loc='best') 阅读全文
posted @ 2018-07-30 19:48 菜鸟key 阅读(1769) 评论(0) 推荐(0) 编辑
摘要: plt.grid(b=None, which='major', axis='both', **kwargs) Turn the axes grids on or off. 显示网格 plt.grid(b=True, which='major', axis='y') Set the axes grid 阅读全文
posted @ 2018-07-30 18:57 菜鸟key 阅读(4865) 评论(0) 推荐(0) 编辑
摘要: import matplotlib.pyplot as plt plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签 plt.rcParams['axes.unicode_minus']=False #用来正常显示负号 #有中文出现的情况,需要 阅读全文
posted @ 2018-07-30 17:28 菜鸟key 阅读(327) 评论(0) 推荐(0) 编辑
摘要: plt.subplot2grid shape : sequence of 2 ints loc : sequence of 2 ints rowspan : int Number of rows for the axis to span to the right. colspan : int Num 阅读全文
posted @ 2018-07-30 17:19 菜鸟key 阅读(6319) 评论(0) 推荐(0) 编辑
摘要: 1 Python title() 方法返回"标题化"的字符串,就是说所有单词都是以大写开始,其余字母均为小写(见 istitle()) str.title() 2 类的继承 meshgrid函数通常在数据的矢量化上使用,但是使用的方法我暂时还不是很明确。而meshgrid的作用适用于生成网格型数据, 阅读全文
posted @ 2018-07-29 16:04 菜鸟key 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 转自:https://www.cnblogs.com/chamie/p/4917820.html 转自:https://www.cnblogs.com/chamie/p/4917820.html random() random()方法:返回随机生成的一个实数,它在[0,1)范围内 运用random( 阅读全文
posted @ 2018-07-29 15:12 菜鸟key 阅读(2095) 评论(0) 推荐(0) 编辑
摘要: 翻译自官网的文档。转自http://www.mamicode.com/info-detail-507676.html 随机抽样 (numpy.random) 简单的随机数据 rand(d0, d1, ..., dn) 随机值 >>> np.random.rand(3,2) array([[ 0.14 阅读全文
posted @ 2018-07-29 15:09 菜鸟key 阅读(824) 评论(0) 推荐(0) 编辑
摘要: set()函数 data = set('like') data.add('love') 把传入的元素作为整体添加到集合中 data.update('love') 拆分'love',作为个体传入 data.remove('love') 删除方法 list.count() 阅读全文
posted @ 2018-04-13 10:58 菜鸟key 阅读(75) 评论(0) 推荐(0) 编辑
摘要: dir(math) ['__doc__', '__loader__', '__name__', '__package__', '__spec__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'copysign', 'cos', 'cosh', &# 阅读全文
posted @ 2018-04-13 09:42 菜鸟key 阅读(166) 评论(0) 推荐(0) 编辑
摘要: from numpy import * import operator def createDataSet(): group = array([[1.0, 1.1], [1.0, 1.0], [0, 0], [0, 0.1]]) labels = ['A', 'A', 'B', 'B'] return group, labels def classify0(inX, ... 阅读全文
posted @ 2018-04-12 17:46 菜鸟key 阅读(116) 评论(0) 推荐(0) 编辑