Python中的Numpy、SciPy、MatPlotLib安装教程

之前采用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
如果不想看网址的话,直接采用下面的这个方法(网址方法翻译过来的):

  1. window下打开命令行:win+R ,之后 输入cmd打开命令行
  2. 执行python -m pip install -U pip setuptools
  3. 执行完上述命名行之后再执行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 安装完毕

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值