本文整理匯總了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)
示例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)