numpy中,矩阵的三种转置transpose、getT、getH的区别
来源:互联网 发布:windows中安装ipython 编辑:程序博客网 时间:2024/05/19 03:43
由于没有时间整理,先贴出官方帮助文档,以便知道对矩阵有这三种转置操作,之间的差别以后遇到问题了再整理。
help(np.matrix.H)
Help on property:
Returns the (complex) conjugate transpose of `self`.
Equivalent to ``np.transpose(self)`` if `self` is real-valued.
Parameters
----------
None
Returns
-------
ret : matrix object
complex conjugate transpose of `self`
Examples
--------
x = np.matrix(np.arange(12).reshape((3,4)))
z = x - 1j*x; z
matrix([[ 0. +0.j, 1. -1.j, 2. -2.j, 3. -3.j],
[ 4. -4.j, 5. -5.j, 6. -6.j, 7. -7.j],
[ 8. -8.j, 9. -9.j, 10.-10.j, 11.-11.j]])
z.getH()
matrix([[ 0. +0.j, 4. +4.j, 8. +8.j],
[ 1. +1.j, 5. +5.j, 9. +9.j],
[ 2. +2.j, 6. +6.j, 10.+10.j],
[ 3. +3.j, 7. +7.j, 11.+11.j]])
help(np.matrix.T)
Help on property:
Returns the transpose of the matrix.
Does *not* conjugate! For the complex conjugate transpose, use ``.H``.
Parameters
----------
None
Returns
-------
ret : matrix object
The (non-conjugated) transpose of the matrix.
See Also
--------
transpose, getH
Examples
--------
m = np.matrix('[1, 2; 3, 4]')
m
matrix([[1, 2],
[3, 4]])
m.getT()
matrix([[1, 3],
[2, 4]])
help(np.matrix.transpose)
Help on method_descriptor:
transpose(...)
a.transpose(*axes)
Returns a view of the array with axes transposed.
For a 1-D array, this has no effect. (To change between column and
row vectors, first cast the 1-D array into a matrix object.)
For a 2-D array, this is the usual matrix transpose.
For an n-D array, if axes are given, their order indicates how the
axes are permuted (see Examples). If axes are not provided and
``a.shape = (i[0], i[1], ... i[n-2], i[n-1])``, then
``a.transpose().shape = (i[n-1], i[n-2], ... i[1], i[0])``.
Parameters
----------
axes : None, tuple of ints, or `n` ints
* None or no argument: reverses the order of the axes.
* tuple of ints: `i` in the `j`-th place in the tuple means `a`'s
`i`-th axis becomes `a.transpose()`'s `j`-th axis.
* `n` ints: same as an n-tuple of the same ints (this form is
intended simply as a "convenience" alternative to the tuple form)
Returns
-------
out : ndarray
View of `a`, with axes suitably permuted.
See Also
--------
ndarray.T : Array property returning the array transposed.
Examples
--------
a = np.array([[1, 2], [3, 4]])
a
array([[1, 2],
[3, 4]])
a.transpose()
array([[1, 3],
[2, 4]])
a.transpose((1, 0))
array([[1, 3],
[2, 4]])
a.transpose(1, 0)
array([[1, 3],
[2, 4]])
- numpy中,矩阵的三种转置transpose、getT、getH的区别
- python 中numpy.transpose()的用法
- numpy的getA()/getA1()/getH()/getI()函数
- Numpy的c_和r_以及transpose
- numpy 维度、轴和transpose的理解
- numpy.transpose高维的理解
- NumPy矩阵与数组的区别
- numpy.transpose对三维数组的转置
- numpy.transpose()
- numpy.transpose()
- geth配置中,genesis.json的几个问题
- python的numpy包中矩阵总结
- Python中Numpy矩阵的使用
- numpy中transpose和swapaxes函数讲解
- numpy 矩阵的用法
- MATLAB与numpy矩阵中元素位运算的实现区别
- lua语言中transpose()函数的用法
- Numpy基于元素的乘法和矩阵乘法的区别
- python itertools.chain 乘号* 实例
- ZOJ
- 2423: [HAOI2010]最长公共子序列
- Iowait的成因、对系统影响及对策
- .NET从入门到放弃之C#反射
- numpy中,矩阵的三种转置transpose、getT、getH的区别
- Openwrt学习笔记 通用固件 make menuconfig配置
- Android 关闭软键盘
- C++命名空间namespace
- Is this a triangle? -- 7kyu
- HDU 2612 Find a way——bfs
- 【C】表达式
- Netty in action—Netty传输服务
- MONGODB资料整理