当前位置: 首页>>代码示例>>Python>>正文


Python numeric.arctanh方法代码示例

本文整理汇总了Python中numpy.core.numeric.arctanh方法的典型用法代码示例。如果您正苦于以下问题:Python numeric.arctanh方法的具体用法?Python numeric.arctanh怎么用?Python numeric.arctanh使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在numpy.core.numeric的用法示例。


在下文中一共展示了numeric.arctanh方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: arctanh

# 需要导入模块: from numpy.core import numeric [as 别名]
# 或者: from numpy.core.numeric import arctanh [as 别名]
def arctanh(x):
    """
    Compute the inverse hyperbolic tangent of `x`.

    Return the "principal value" (for a description of this, see
    `numpy.arctanh`) of `arctanh(x)`. For real `x` such that
    `abs(x) < 1`, this is a real number.  If `abs(x) > 1`, or if `x` is
    complex, the result is complex. Finally, `x = 1` returns``inf`` and
    `x=-1` returns ``-inf``.

    Parameters
    ----------
    x : array_like
       The value(s) whose arctanh is (are) required.

    Returns
    -------
    out : ndarray or scalar
       The inverse hyperbolic tangent(s) of the `x` value(s). If `x` was
       a scalar so is `out`, otherwise an array is returned.


    See Also
    --------
    numpy.arctanh

    Notes
    -----
    For an arctanh() that returns ``NAN`` when real `x` is not in the
    interval ``(-1,1)``, use `numpy.arctanh` (this latter, however, does
    return +/-inf for `x = +/-1`).

    Examples
    --------
    >>> np.set_printoptions(precision=4)

    >>> np.emath.arctanh(np.eye(2))
    array([[ Inf,   0.],
           [  0.,  Inf]])
    >>> np.emath.arctanh([1j])
    array([ 0.+0.7854j])

    """
    x = _fix_real_abs_gt_1(x)
    return nx.arctanh(x) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:47,代码来源:scimath.py

示例2: arctanh

# 需要导入模块: from numpy.core import numeric [as 别名]
# 或者: from numpy.core.numeric import arctanh [as 别名]
def arctanh(x):
    """
    Compute the inverse hyperbolic tangent of `x`.

    Return the "principal value" (for a description of this, see
    `numpy.arctanh`) of `arctanh(x)`. For real `x` such that
    `abs(x) < 1`, this is a real number.  If `abs(x) > 1`, or if `x` is
    complex, the result is complex. Finally, `x = 1` returns``inf`` and
    `x=-1` returns ``-inf``.

    Parameters
    ----------
    x : array_like
       The value(s) whose arctanh is (are) required.

    Returns
    -------
    out : ndarray or scalar
       The inverse hyperbolic tangent(s) of the `x` value(s). If `x` was
       a scalar so is `out`, otherwise an array is returned.


    See Also
    --------
    numpy.arctanh

    Notes
    -----
    For an arctanh() that returns ``NAN`` when real `x` is not in the
    interval ``(-1,1)``, use `numpy.arctanh` (this latter, however, does
    return +/-inf for `x = +/-1`).

    Examples
    --------
    >>> np.set_printoptions(precision=4)

    >>> np.emath.arctanh(np.matrix(np.eye(2)))
    array([[ Inf,   0.],
           [  0.,  Inf]])
    >>> np.emath.arctanh([1j])
    array([ 0.+0.7854j])

    """
    x = _fix_real_abs_gt_1(x)
    return nx.arctanh(x) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:47,代码来源:scimath.py


注:本文中的numpy.core.numeric.arctanh方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。