本文简要介绍 python 语言中  numpy.hypot  的用法。
- 用法:- numpy.hypot(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True [, signature, extobj ]) = <ufunc 'hypot'>
- 给定直角三角形的“legs”,返回它的斜边。 - 相当于 - sqrt(x1**2 + x2**2),逐元素。如果x1或者x2是scalar_like(即,明确地cast-able为标量类型),它被广播以与其他参数的每个元素一起使用。 (参见示例)- x1, x2: array_like
- 三角形的腿。如果 - x1.shape != x2.shape,它们必须可以广播到一个公共形状(成为输出的形状)。
- out: ndarray,None,或 ndarray 和 None 的元组,可选
- 存储结果的位置。如果提供,它必须具有输入广播到的形状。如果未提供或 None,则返回一个新分配的数组。元组(只能作为关键字参数)的长度必须等于输出的数量。 
- where: 数组,可选
- 此条件通过输入广播。在条件为真的位置,out数组将设置为 ufunc 结果。在其他地方,out数组将保留其原始值。请注意,如果未初始化out数组是通过默认创建的 - out=None,其中条件为 False 的位置将保持未初始化状态。
- **kwargs:
- 对于其他仅关键字参数,请参阅 ufunc 文档。 
 
- z: ndarray
- 三角形的斜边。如果 x1 和 x2 都是标量,则这是一个标量。 
 
 - 参数:- 返回:- 例子:- >>> np.hypot(3*np.ones((3, 3)), 4*np.ones((3, 3))) array([[ 5., 5., 5.], [ 5., 5., 5.], [ 5., 5., 5.]])- 显示scalar_like 参数广播的示例: - >>> np.hypot(3*np.ones((3, 3)), [4]) array([[ 5., 5., 5.], [ 5., 5., 5.], [ 5., 5., 5.]])
相关用法
- Python numpy hamming用法及代码示例
- Python numpy hermite.hermfromroots用法及代码示例
- Python numpy hermite_e.hermediv用法及代码示例
- Python numpy hsplit用法及代码示例
- Python numpy hermite.hermline用法及代码示例
- Python numpy hermite.hermpow用法及代码示例
- Python numpy hermite.hermx用法及代码示例
- Python numpy hermite_e.hermefromroots用法及代码示例
- Python numpy hermite.hermmul用法及代码示例
- Python numpy hermite.herm2poly用法及代码示例
- Python numpy hermite.hermsub用法及代码示例
- Python numpy hermite_e.hermeline用法及代码示例
- Python numpy hermite_e.hermeint用法及代码示例
- Python numpy hermite_e.hermeadd用法及代码示例
- Python numpy hstack用法及代码示例
- Python numpy hermite_e.poly2herme用法及代码示例
- Python numpy hermite.hermdiv用法及代码示例
- Python numpy hermite_e.hermevander用法及代码示例
- Python numpy hermite_e.hermepow用法及代码示例
- Python numpy hermite.poly2herm用法及代码示例
- Python numpy hermite_e.hermetrim用法及代码示例
- Python numpy hermite_e.hermezero用法及代码示例
- Python numpy hermite.hermdomain用法及代码示例
- Python numpy hermite_e.hermex用法及代码示例
- Python numpy histogramdd用法及代码示例
注:本文由纯净天空筛选整理自numpy.org大神的英文原创作品 numpy.hypot。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
