python numpy库
来源:互联网 发布:粤语软件哪个好 编辑:程序博客网 时间:2024/05/19 08:01
记录几个numpy中经常用到的函数
创建数组
NumPy 的核心是数组(arrays)。具体来说是多维数组(ndarrays)
import numpy as npa = np.array((0, 1, 2, 3, 4))b = np.array([0, 1, 2, 3, 4])c = np.arange(5)d = np.linspace(0, 10, 5) #[ 0. 2.5 5. 7.5 10. ]分成五份print aprint bprint cprint d[0 1 2 3 4]
[0 1 2 3 4]
[0 1 2 3 4]
[ 0. 2.5 5. 7.5 10. ]
import numpy as npa = np.array([[11, 12, 13, 14, 15], [16, 17, 18, 19, 20], [21, 22, 23, 24, 25], [26, 27, 28, 29, 30], [31, 32, 33, 34, 35]])print a[2][2] # 23
import numpy as npa = np.array([[11, 12, 13, 14, 15], [16, 17, 18, 19, 20], [21, 22, 23, 24, 25], [26, 27, 28, 29, 30], [31, 32, 33, 34, 35]])print a[2][2] #a[2,2] 23print a[0][1:4] #a[0,1:4] [12 13 14]print a[::2, ::2] #[[11 13 15] # [21 23 25] # [31 33 35]]print a[:,1] #[12 17 22 27 32]
0 0
- python -numpy 库
- python库之numpy
- python安装numpy库
- python numpy库
- [Python] Numpy库
- Python 中的numpy 库
- Python之NumPy库
- python numpy库
- python Numpy库
- python numpy模块/库
- python的numpy库
- python numpy库详解
- python库-numpy
- Python之Numpy库
- python中的numpy库的numpy.asarray
- python 机器学习库:Numpy
- python numpy 库学习笔记
- python库numpy的使用
- 求帮助,不知道为什么文件打不开,以下是我的代码,求前辈指导一下。
- Free Download Scr888 WhoSpunIt Slot Game
- git常用的命令
- 基于Java+Selenium+Appium集成Web、安卓和IOS自动化测试框架的设计
- MySQL 5.5版本解决中文乱码问题时my.ini内[mysqld]项中不能再写default-character-set=utf8
- python numpy库
- 作业
- ensemble learning(集成学习)笔记
- 持续更新中的(别人写的)简便算法
- webpack入门与解析(一)
- c++判断素数
- redis重启之后丢失数据
- 实现在windows、linux下上传ios app到App Store
- js获取margin值要再次定义,才能获取