python numpy矩阵和数组的转换
2015-06-30 23:35
645 查看
数组转换矩阵:
A = mat(s[])
矩阵转换数组:
s[]= A.getA()
举例:
s=[[4,2],[3,2],[3,1]]
A =mat(s)
A
matrix([[4, 2],
[3, 2],
[3, 1]])
ss = A.getA()
ss
array([[4, 2],
[3, 2],
[3, 1]])
A = mat(s[])
矩阵转换数组:
s[]= A.getA()
举例:
s=[[4,2],[3,2],[3,1]]
A =mat(s)
A
matrix([[4, 2],
[3, 2],
[3, 1]])
ss = A.getA()
ss
array([[4, 2],
[3, 2],
[3, 1]])
相关文章推荐
- Think In Python Exercise
- python 简单图像处理(13)
- Python学习之二【初学Python】
- 最近在学习python
- python装饰器
- python 优秀文章索引
- python编程之键盘响应
- Python学习十四:filter()
- Python图像处理(12):贝叶斯分类器
- python脚本
- Python实现决策树算法
- Python学习十三:map/reduce
- Python Decorator
- windows系统下Python环境的搭建
- Python LoggerAdpater类
- python ConfigParse模块(转)
- Python-strip()方法
- python中的元类metaclass
- Python文件操作
- Python读写文件实际操作的五大步骤