码迷,mamicode.com
首页 >  
搜索关键字:np    ( 2362个结果
python 矩阵转置transpose
在读图片时,会用到这么的一段代码: image_vector_len = np.prod(image_size)#总元素大小,3*55*47 img = Image.open(path) arr_img = np.asarray(img, dtype='float64') arr_img = arr ...
分类:编程语言   时间:2017-04-25 19:13:48    阅读次数:323
nodejs express
安装 假设您已经安装了 Node.js,创建目录以保存应用程序,并将其设置为工作目录。$ mkdir myapp$ cd myapp使用 npm init 命令为应用程序创建 package.json 文件。 有关 package.json 工作方式的更多信息,请参阅 Specifics of np ...
分类:Web程序   时间:2017-04-20 17:03:13    阅读次数:185
python k-means聚类实例
port sys reload(sys) sys.setdefaultencoding('utf-8') import matplotlib.pyplot as plt import numpy as np culster1 = np.random.uniform(0.5, 1.5, (2, 20)... ...
分类:编程语言   时间:2017-04-16 22:14:03    阅读次数:542
CentOS安装CLI
#使用root账号 vim /etc/yum.repos.d/epel.repo [epel] name=epel baseurl=http://mirrors.sohu.com/fedora-epel/6/$basearch enabled=1 gpgcheck=0 用yum安装nodejs和np ...
分类:其他好文   时间:2017-04-12 14:23:46    阅读次数:326
P和NP问题
什么是P,什么是NP问题?看论文的过程中,经常出现P=NP或者P!=NP问题,经常困扰着我,让我无时无刻想去搞懂到底什么是P,什么是NP。P(polynomial)P就是能在多项式时间内能够解决的问题。NP(Non-deterministicpolynomial)也就是非确定的多项式,即是难解问题。那么第二个问题..
分类:其他好文   时间:2017-04-12 05:14:33    阅读次数:148
[Python] Scipy and Numpy(1)
import numpy as np #Create an array of 1*10^7 elements arr = np.arange(1e7) #Converting ndarray to list larr = arr.tolist() #Create a 2D numpy array a... ...
分类:编程语言   时间:2017-04-11 16:53:11    阅读次数:370
python--Numpy简单实用实例
# _*_ coding:utf-8 _*_ import numpy as np #创建数组 a=np.array([[1.,7.,0.],[-2.,1.,2.]]) print a #ndarray的主要属性: #ndarry.ndim数组行数 print a.ndim #naarray.sha... ...
分类:编程语言   时间:2017-04-10 00:33:45    阅读次数:235
NP 问题
NP问题 一、什么是NP问题? 在搞清楚NP之前,必须弄清楚P问题,P问题就是在多项式时间内可解的问题。假设问题的输入规模为n,它的解运行需要的时间不会 超过它的关于n的多项式时间。那么NP就是,虽然在多项式时间内不能解决,但是能够在多项式时间内验证一个解。所以,很自然人们就想 NP和P到底相不相等 ...
分类:其他好文   时间:2017-04-08 16:10:55    阅读次数:140
numpy基础语法
np.zeros(5) [ 0. 0. 0. 0. 0.] 所得类型为数组, numpy.zeros_like(a, dtype=None, order='K', subok=True) 生成一个和a维数相同的全零数组 ...
分类:其他好文   时间:2017-04-06 23:19:23    阅读次数:184
利用python进行数据分析1【numpy】
1.高维向量转置 Q: A: 2.其他函数 3.np.where(cond,xarr,yarr) cond是条件,xarr,yarr可以是数组,也可以是标量值 1~ 2~ 4. axis=1,水平方向,0~垂直方向 5.sort()排序 arr.sort() , sorted() 5. 6.线性代数 ...
分类:编程语言   时间:2017-04-06 20:06:37    阅读次数:234
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!