|
NumPy学习笔记 一
《NumPy学习笔记》系列将记录学习NumPy过程中的动手笔记,前期的参考书是《Python数据分析基础教程 NumPy学习指南》第二版、《数学分析》第四版(华东师范大学数学系)、《概率论与数理统计》(陈希孺,中科大出版)、《概率论与数理统计》第二版(茆诗松、程依明等编)、《组合最优化:理论与方法》(现代数学译丛23)。笔记一主要记录NumPy&SciPy及相关软件的环境准备部分。
NumPy的官方网站上(http://www.numpy.org/)详细介绍了三种安装NumPy&SciPy的方法(https://www.scipy.org/scipylib/download.html):
一. 官方源码及二进制发布
Project
| Available packages
| Download location
| NumPy
| Official source code (all platforms) and binariesfor Windows, Linux and Mac OS X
| PyPI page for NumPy
| SciPy
| Official source code (all platforms) and binariesfor Windows, Linux and Mac OS X
|
SciPy release page (sources)
PyPI page for SciPy (all)
| 推荐使用Python pip来安装,简单,并且获取的是最新的发布版。
以下命令在ubuntu 17.10上安装NumPy&SciPy
sudo apt install python3-pip
pip3 install numpy
pip3 install scipy
二. 访问源代码仓库
NumPy和SciPy的官方仓库都在Github上。
检出最新的NumPy源码:
git clone https://github.com/numpy/numpy.git
检出最新的SciPy源码:
git clone https://github.com/scipy/scipy.git
编译参考:https://docs.scipy.org/doc/scipy-dev/reference/building/index.html
三. 第三方/供应商 包管理器
下面是部分第三方和操作系统供应商包管理器包含的NumPy和SciPy包
Distribution
|
NumPy Packages
|
SciPy Packages
| Arch Linux
| python-numpy
| python-scipy
| Debian GNU/Linux
| python-numpy
| python-scipy
| Ubuntu Linux
| python-numpy
| python-scipy
| Fedora
| numpy
| scipy
| Fink
| numpy-py27, numpy-py35
| scipy-py27, scipy-py35
| FreeBSD (Ports)
| math/py-numpy
| science/py-scipy
| Gentoo Linux
| dev-python/numpy
| sci-libs/scipy
| MacPorts
| py-numpy,
| py-scipy,
| NetBSD (pkgsrc)
| math/py-numpy
| math/py-scipy
| OpenSUSE
| python-numpy, python-numpy-devel
| python-scipy, python-scipy-devel
| Slackware Linux
| numpy (slackbuilds.org)
| scipy (slackbuilds.org)
| 在Ubuntu 17.10上安装通过apt包管理器安装
sudo apt install num-py
sudo apt install python-numpy
不推荐使用该种方式,因为获取的软件版本往往较低。
安装matplotlib和ipython,同样推荐使用pip安装:
pip3 install matplotlib
pip3 install ipython |
|
|