本文简要介绍 python 语言中 numpy.imag
的用法。
用法:
numpy.imag(val)
返回复数参数的虚部。
- val: array_like
输入数组。
- out: ndarray 或标量
复杂论证的虚部。如果 val 是实数,则 val 的类型用于输出。如果 val 具有复杂元素,则返回类型为 float。
参数:
返回:
例子:
>>> a = np.array([1+2j, 3+4j, 5+6j]) >>> a.imag array([2., 4., 6.]) >>> a.imag = np.array([8, 10, 12]) >>> a array([1. +8.j, 3.+10.j, 5.+12.j]) >>> np.imag(1 + 1j) 1.0
相关用法
- Python numpy isclose用法及代码示例
- Python numpy issctype用法及代码示例
- Python numpy isnat用法及代码示例
- Python numpy is_busday用法及代码示例
- Python numpy isposinf用法及代码示例
- Python numpy issubdtype用法及代码示例
- Python numpy issubclass_用法及代码示例
- Python numpy interp用法及代码示例
- Python numpy issubsctype用法及代码示例
- Python numpy iscomplexobj用法及代码示例
- Python numpy iinfo用法及代码示例
- Python numpy in1d用法及代码示例
- Python numpy indices用法及代码示例
- Python numpy isfinite用法及代码示例
- Python numpy ix_用法及代码示例
- Python numpy iscomplex用法及代码示例
- Python numpy isin用法及代码示例
- Python numpy insert用法及代码示例
- Python numpy i0用法及代码示例
- Python numpy intersect1d用法及代码示例
- Python numpy isinf用法及代码示例
- Python numpy identity用法及代码示例
- Python numpy isrealobj用法及代码示例
- Python numpy ipmt用法及代码示例
- Python numpy isscalar用法及代码示例
注:本文由纯净天空筛选整理自numpy.org大神的英文原创作品 numpy.imag。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。