之前采用python来进行数据分析,就把这些安装了。
我的环境是python 2.7 pip window7 64位操作系统 pycharm编译器。(环境不一样也是基本可以参照这个教程安装的)
但是对于一些小白来说,网上有很多第三方资源都是在官网下载好以后上传的,下载的时候需要一定的积分,而对于有一部份人来说,积分不够或者是其他什么的。这个教程是基于Numpy、SciPy、MatPlotLib的官网来的直接按照操作步骤来就可以安装了。
(1)安装NumPy,点击下列网址进去,找到自己的版本,例如我的python是2.7。再下载相应的exe文件。
NumPy: http://sourceforge.net/projects/numpy/files/NumPy/1.9.2/
页面截图
(2)安装MatPlotLib。安装方法参考自网址:http://matplotlib.org/users/installing.html
如果不想看网址的话,直接采用下面的这个方法(网址方法翻译过来的):
- window下打开命令行:win+R ,之后 输入cmd打开命令行
- 执行
python -m pip install -U pip setuptools
- 执行完上述命名行之后再执行
python -m pip install matplotlib
运行截图
安装完成
这样就可以了,它会自己帮你安装所需要的环境配置的东西(前提是你已经安装好pip和python运行环境,这个网上的教程还是很多的)
测试MatPlotLib和Numpy是否安装成功:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : SundayCoder-俊勇
# @File : teset.py
import numpy as np
import matplotlib.pyplot as plt
N = 5
menMeans = (20, 35, 30, 35, 27)
menStd = (2, 3, 4, 1, 2)
ind = np.arange(N) # the x locations for the groups
width = 0.35 # the width of the bars
fig, ax = plt.subplots()
rects1 = ax.bar(ind, menMeans, width, color='r', yerr=menStd)
womenMeans = (25, 32, 34, 20, 25)
womenStd = (3, 5, 2, 3, 3)
rects2 = ax.bar(ind+width, womenMeans, width, color='y', yerr=womenStd)
# add some
ax.set_ylabel('Scores')
ax.set_title('Scores by group and gender')
ax.set_xticks(ind+width)
ax.set_xticklabels( ('G1', 'G2', 'G3', 'G4', 'G5') )
ax.legend( (rects1[0], rects2[0]), ('Men', 'Women') )
def autolabel(rects):
# attach some text labels
for rect in rects:
height = rect.get_height()
ax.text(rect.get_x()+rect.get_width()/2., 1.05*height, '%d'%int(height),
ha='center', va='bottom')
autolabel(rects1)
autolabel(rects2)
plt.show()
运行截图:
到这一步就安装好了Numpy、MatPlotLib。
对于测试是否安装的程序是网上随便找的,若是造成了侵权请联系我删除
(3)SciPy的安装打开网址可以看到目前是python3.4的exe,如果你的python是3.4版本的你就直接下载。
SciPy:https://sourceforge.net/projects/scipy/files/
运行截图
如果你的是2.7版本的话呢?
打开:https://sourceforge.net/projects/scipy/files/scipy/0.16.0/
找到你的版本,和Numpy的安装一样的一样的。
运行截图:
Ok 安装完毕