当前位置:网站首页>NumPy学习挑战第一关-NumPy的下载与安装
NumPy学习挑战第一关-NumPy的下载与安装
2022-06-26 06:44:00 【云曦我女神】
NumPy 安装
Python 官网上的发行版是不包含 NumPy 模块的。
我们可以使用以下几种方法来安装。
1、使用已有的发行版本
对于许多用户,尤其是在 Windows 上,最简单的方法是下载以下的 Python 发行版,它们包含了所有的关键包(NumPy,SciPy,matplotlib,IPython,SymPy 以及 Python 核心自带的其它包):
- Anaconda: 免费 Python 发行版,用于进行大规模数据处理、预测分析,和科学计算,致力于简化包的管理和部署。支持 Linux, Windows 和 Mac 系统。
- Enthought Canopy: 提供了免费和商业发行版。持 Linux, Windows 和 Mac 系统。
- Python(x,y): 免费的 Python 发行版,包含了完整的 Python 语言开发包 及 Spyder IDE。支持 Windows,仅限 Python 2 版本。
WinPython: 另一个免费的 Python 发行版,包含科学计算包与 Spyder IDE。支持 Windows。 - Pyzo: 基于 Anaconda 的免费发行版本及 IEP 的交互开发环境,超轻量级。 支持 Linux, Windows 和 Mac 系统。
2、使用 pip 安装
安装 NumPy 最简单的方法就是使用 pip 工具:
pip3 install --user numpy scipy matplotlib
–user 选项可以设置只安装在当前的用户下,而不是写入到系统目录。
默认情况使用国外线路,国外太慢,我们使用清华的镜像就可以:
pip3 install numpy scipy matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
Linux 下安装
Ubuntu & Debian
sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose
CentOS/Fedora
sudo dnf install numpy scipy python-matplotlib ipython python-pandas sympy python-nose atlas-devel
Mac 系统
Mac 系统的 Homebrew 不包含 NumPy 或其他一些科学计算包,所以可以使用以下方式来安装:
pip3 install numpy scipy matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
安装验证
测试是否安装成功:
>>>from numpy import *
>>>eye(4)
array([[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]])
#from numpy import * 为导入 numpy 库。
#eye(4) 生成对角矩阵。
因为我准备学习Python数据分析(为数学建模做准备),所以我选择了Anaconda这个免费的Python发行版,如果你也想下载安装,可以到清华镜像源下载,然后找相关安装教程,一步一步跟着教程安装即可。
边栏推荐
- My SQL (II)
- MySQL基础用法01
- JS download pictures
- 浅析一道经典题
- 遇到女司机业余开滴滴,日入500!
- Kotlin Compose 状态恢复 rememberSaveable 与 remember
- Container with the most water
- Analyse d'un problème classique
- [digital signal processing] basic sequence (unit step sequence | relationship between unit step sequence and unit pulse sequence | rectangular sequence | relationship between rectangular sequence and
- I caught a 10-year-old Alibaba test developer in the company. After chatting with him, I realized everything
猜你喜欢

If you meet a female driver who drives didi as an amateur, you can earn 500 yuan a day!

数据挖掘是什么?

Guide to "avoid dismissal during probation period"

Jasminum plug-in of Zotero document management tool
Alarm operation and Maintenance Center | build an efficient and accurate alarm collaborative processing system

How to set MySQL triggers is a simple tutorial for novices

PyTorch搭建CNN-LSTM混合模型实现多变量多步长时间序列预测(负荷预测)

Load balancer does not have available server for client: userService问题解决

Vulnerability discovery - API interface service vulnerability probe type utilization and repair

MySQL (III)
随机推荐
Spark3.3.0源码编译补充篇-抓狂的证书问题
【图像融合】基于梯度能量、局部能量、 PCA三种融合规则实现MRI-CT图像融合附matlab代码
ts中枚举类型(enum)简单使用
[digital signal processing] basic sequence (basic sequence lists | unit pulse sequence | unit pulse function | discrete unit pulse function | difference between unit pulse function and discrete unit p
【特征提取】基于稀疏PCA实现目标识别信息特征选择附matlab源码
Everything is a vector. The service practice of iqiyi online vector recall project
If you meet a female driver who drives didi as an amateur, you can earn 500 yuan a day!
Go language learning notes 1.2- variables
Go language learning notes 1.1
Analyse d'un problème classique
数据湖架构之Hudi编译篇
Research Report on market supply and demand and strategy of natural organic beauty industry in China
My SQL(二)
The four cores of the browser: Trident, gecko, WebKit, blink
MySQL delete in without index
Shell编程-用户信息管理
Phantom star VR equipment product details II: dark battlefield
Pagoda server setup and database remote connection
Dpdk - tcp/udp protocol stack server implementation (I)
China polyphenylene oxide Market Development Prospect and Investment Strategy Research Report 2022-2027