本文简要介绍 python 语言中 numpy.lcm
的用法。
用法:
numpy.lcm(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True [, signature, extobj ]) = <ufunc 'lcm'>
返回
|x1|
和|x2|
的最小公倍数- x1, x2: 数组样,int
值数组。如果
x1.shape != x2.shape
,它们必须可以广播到一个公共形状(成为输出的形状)。
- y: ndarray 或标量
输入绝对值的最小公倍数 如果 x1 和 x2 都是标量,则这是一个标量。
参数:
返回:
例子:
>>> np.lcm(12, 20) 60 >>> np.lcm.reduce([3, 12, 20]) 60 >>> np.lcm.reduce([40, 12, 20]) 120 >>> np.lcm(np.arange(6), 20) array([ 0, 20, 20, 60, 20, 20])
相关用法
- Python numpy legendre.legint用法及代码示例
- Python numpy linalg.svd用法及代码示例
- Python numpy laguerre.lagone用法及代码示例
- Python numpy linalg.pinv用法及代码示例
- Python numpy logaddexp用法及代码示例
- Python numpy linalg.eigh用法及代码示例
- Python numpy linalg.tensorinv用法及代码示例
- Python numpy laguerre.lagdomain用法及代码示例
- Python numpy laguerre.lagzero用法及代码示例
- Python numpy legendre.legmulx用法及代码示例
- Python numpy less用法及代码示例
- Python numpy linalg.LinAlgError用法及代码示例
- Python numpy linalg.matrix_rank用法及代码示例
- Python numpy legendre.legroots用法及代码示例
- Python numpy legendre.legdomain用法及代码示例
- Python numpy laguerre.lagdiv用法及代码示例
- Python numpy log10用法及代码示例
- Python numpy load用法及代码示例
- Python numpy laguerre.poly2lag用法及代码示例
- Python numpy legendre.legfromroots用法及代码示例
- Python numpy legendre.leg2poly用法及代码示例
- Python numpy logspace用法及代码示例
- Python numpy laguerre.lagx用法及代码示例
- Python numpy legendre.legone用法及代码示例
- Python numpy lib.NumpyVersion用法及代码示例
注:本文由纯净天空筛选整理自numpy.org大神的英文原创作品 numpy.lcm。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。