本文簡要介紹 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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。