
Python 数据分析
---Lavender---
在读研究生
展开
-
numpy scipy matplotlib的安装问题
1、安装scipy时需要使用pip install *.whl,之前尝试easy_install *.whl没有成功。 2、先安装numpy,不能只单纯的安装numpy,要安装numpy+mkl,否则安装scipy时会出错。 3、然后安装scipy,然后安装matplotlib时会出现很多引入模块错误,按照错误提示,依次安装好几个相关的库,之前每个库下载的.whl的文件,但是出现 Couldn原创 2017-03-29 15:03:32 · 541 阅读 · 0 评论 -
np.sum
import numpy as np a = np.sum([[1,2],[2,3]]) print(a)#8,矩阵中所有元素相加 b = np.sum([[1,2],[2,3]],axis=0) print(b)#[3 5],每列之和 c = np.sum([[1,2],[4,3]],axis=1) print(c)#[3 7],每行之和 d = np.sum([0.5, 0.7,原创 2017-08-03 09:47:59 · 574 阅读 · 0 评论 -
np.cumsum()
import numpy as np a = np.cumsum([[1,2],[2,3]]) print(a)#[1 3 5 8],由前面的值依次累加 b = np.cumsum([[1,2],[2,3]],axis=0) print(b) #[[1 2] # [3 5]] #每列累加 c = np.cumsum([[1,2],[2,3]],axis=1) print(原创 2017-08-03 09:53:55 · 1305 阅读 · 0 评论