numpy 矩阵的用法
来源:互联网 发布:最新网络流行语段子 编辑:程序博客网 时间:2024/06/05 10:19
b=list(range(5))
b
[0, 1, 2, 3, 4] #列表
区别
a=np.arange(5)
a
array([0, 1, 2, 3, 4])# 矩阵
生成一个1*24的矩阵,在将她变成2*3*4的数体
c=np.arange(24).reshape(2,3,4)
c
Out[301]:
array([[[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11]],
[[12, 13, 14, 15],
[16, 17, 18, 19],
[20, 21, 22, 23]]])
c.shape
Out[303]: (2, 3, 4)
c[0,0,0]
Out[305]: 0
数体的第一层楼
c[0] #同c[0,:,:] c[0,...]
Out[306]:
array([[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11]])
c[:,0,0] 一到二楼的00位置元素
Out[309]: array([ 0, 12])
感谢Ivan idris
0 0
- numpy 矩阵的用法
- numpy矩阵相乘@的用法
- python numpy 矩阵用法
- numpy中矩阵相乘的用法:dot函数和乘号*
- numpy 矩阵运算的陷阱
- numpy的矩阵运算笔记
- numpy矩阵的基础操作
- numpy.average的用法
- numpy nonzero的用法
- numpy tolist()的用法
- numpy的基础用法
- numpy的函数用法
- numpy的用法part1
- Python Numpy的数组array和矩阵matrix的用法与区别
- numpy.c_和numpy.squeeze的用法
- numpy.cov()和numpy.var()的用法
- SVM numpy sign的用法
- python之numpy的用法
- ionic 购物车全选,单选
- ueditor+requirejs+springMVC+七牛(富文本编辑器图片上传到指定服务器)
- 使用ListView更新数据一直闪烁的解决办法
- bzoj 3670 kmp
- android中ListView多次刷新重复执行getView的解决方法
- numpy 矩阵的用法
- 严重:Error configuring application listener of class org.springframework.web.context.ContextLoaderList
- 使用webmagic 爬取天气网站
- Git 基本操作
- 获取界面传值
- sql语句update中多个case/when的写法
- Java并发编程:Lock
- Android--面试中遇到的问题总结(三)
- 系统到底需不需要升级?