
python
michaelhan3
这个作者很懒,什么都没留下…
展开
-
np.max 与 np.maximum
原文地址:http://blog.youkuaiyun.com/lanchunhui/article/details/527008951. 参数首先比较二者的参数部分:np.max:(a, axis=None, out=None, keepdims=False) 求序列的最值最少接收一个参数axis:默认为列向(也即 axis=0),axis = 1 时为行方向转载 2017-04-09 11:01:01 · 513 阅读 · 0 评论 -
python scatter参数详解
原文地址:http://blog.youkuaiyun.com/u013634684/article/details/49646311最近开始学习Python编程,遇到scatter函数,感觉里面的参数不知道什么意思于是查资料,最后总结如下:1、scatter函数原型2、其中散点的形状参数marker如下:3、其中颜色参数c如下:4、基本的使用方法如下:转载 2017-07-01 00:14:24 · 1377 阅读 · 0 评论 -
Python split()方法
原文地址:http://www.runoob.com/python/att-string-split.html Python 字符串描述Python split()通过指定分隔符对字符串进行切片,如果参数num 有指定值,则仅分隔 num 个子字符串语法split()方法语法:str.split(str="", num=string.转载 2017-06-30 22:04:39 · 435 阅读 · 0 评论 -
Python格式化输出
原文地址:http://www.cnblogs.com/plwang1990/p/3757549.htmlPython格式化输出今天写程序又记不清格式化输出细节了……= =索性整理一下。python print格式化输出。1. 打印字符串print ("His name is %s"%("Aviad"))效果:2.打印整数prin转载 2017-06-30 21:51:29 · 309 阅读 · 0 评论 -
python中 __name__及__main()__的妙处
原文地址:http://www.cnblogs.com/liqilei/archive/2010/08/11/1797715.html#hello.pydef sayHello(): str="hello" print(str);if __name__ == "__main__": print ('This is main of module "hel转载 2017-06-30 09:17:48 · 226 阅读 · 0 评论 -
Python中的sorted函数以及operator.itemgetter函数
原文地址:http://www.cnblogs.com/100thMountain/p/4719503.htmlPython中的sorted函数以及operator.itemgetter函数operator.itemgetter函数operator模块提供的itemgetter函数用于获取对象的哪些维的数据,参数为一些序号(即需要获取的数据在对象中的序号),下面转载 2017-06-29 22:43:55 · 218 阅读 · 0 评论 -
Python 字典(Dictionary) get()方法
原文地址:http://www.runoob.com/python/att-dictionary-get.htmlPython 字典(Dictionary) get()方法描述Python 字典(Dictionary) get() 函数返回指定键的值,如果值不在字典中返回默认值。语法get()方法语法:dict.get(key, de转载 2017-06-29 22:06:24 · 880 阅读 · 0 评论 -
Python 字典(Dictionary)
原文地址:http://www.runoob.com/python/python-dictionary.htmlPython 字典(Dictionary)字典是另一种可变容器模型,且可存储任意类型对象。字典的每个键值(key=>value)对用冒号(:)分割,每个对之间用逗号(,)分割,整个字典包括在花括号({})中 ,格式如下所示:d =转载 2017-06-29 22:05:05 · 302 阅读 · 0 评论 -
python agrsort()函数
argsort函数返回的是数组值从小到大的索引值>>> disarray([ 1.48660687, 1.41421356, 0. , 0.1 ])>>> sortindex=dis.argsort()>>> sortindexarray([2, 3, 1, 0])>>>原创 2017-06-29 21:51:04 · 796 阅读 · 0 评论 -
python--sum函数--sum(axis=1)
原文地址:http://www.cnblogs.com/chamie/p/4847332.html平时用的sum应该是默认的axis=0 就是普通的相加,当加入axis=1以后就是将一个矩阵的每一行向量相加。例如:1 >>>import numpy as np3 >>>np.sum([[0,1,2],[2,1,3],axis=1)5 array([3,6])转载 2017-06-29 21:30:59 · 1153 阅读 · 1 评论 -
numpy中的tile函数
tile函数 在看机器学习实战这本书时,遇到numpy.tile(A,B)函数,愣是没看懂怎么回事,装了numpy模块后,实验了几把,原来是这样子:重复A,B次,这里的B可以时int类型也可以是远组类型。[python] view plain copy>>> import numpy >>> numpy.t转载 2017-06-29 21:05:18 · 223 阅读 · 0 评论 -
python 中__name__ = '__main__' 的作用
原文地址:http://www.jb51.net/article/51892.htm很多新手刚开始学习python的时候经常会看到python 中__name__ = \'__main__\' 这样的代码,可能很多新手一开始学习的时候都比较疑惑,python 中__name__ = '__main__' 的作用,到底干嘛的?有句话经典的概括了这段代码的意义:“M转载 2017-04-14 17:43:34 · 267 阅读 · 0 评论 -
python中的os.path.join() 作用
是在拼接路径的时候用的。举个例子,os.path.join(“home”, "me", "mywork")在Linux系统上会返回“home/me/mywork"在Windows系统上会返回"home\me\mywork"好处是可以根据系统自动选择正确的路径分隔符"/"或"\"原创 2017-04-14 09:27:57 · 1344 阅读 · 0 评论 -
python 画子图(add_subplot & subplot)
原文地址:点击打开链接子图:就是在一张figure里面生成多张子图。Matplotlib对象简介 FigureCanvas 画布 Figure 图 Axes 坐标轴(实际画图的地方)注意,pyplot的方式中plt.subplot()参数和面向对象中的add转载 2017-07-01 00:18:22 · 46719 阅读 · 3 评论