scipy.special.boxcox1p¶
-
scipy.special.
boxcox1p
(x, lmbda) = <ufunc 'boxcox1p'>¶ Compute the Box-Cox transformation of 1 + x.
The Box-Cox transformation computed by
boxcox1p
is:y = ((1+x)**lmbda - 1) / lmbda if lmbda != 0 log(1+x) if lmbda == 0
Returns nan if
x < -1
. Returns -inf ifx == -1
andlmbda < 0
.- Parameters
- xarray_like
Data to be transformed.
- lmbdaarray_like
Power parameter of the Box-Cox transform.
- Returns
- yarray
Transformed data.
Notes
New in version 0.14.0.
Examples
>>> from scipy.special import boxcox1p >>> boxcox1p(1e-4, [0, 0.5, 1]) array([ 9.99950003e-05, 9.99975001e-05, 1.00000000e-04]) >>> boxcox1p([0.01, 0.1], 0.25) array([ 0.00996272, 0.09645476])