numpy.fabs(x,/,out=None,*,where=True,casting='same_kind',order='K',dtype=None,subok=True[,signature,extobj]) = <ufunc 'fabs'>¶Compute the absolute values element-wise.
This function returns the absolute values (positive magnitude) of thedata inx. Complex values are not handled, useabsolute to find theabsolute values of complex data.
| Parameters: | x : array_like
out : ndarray, None, or tuple of ndarray and None, optional
where : array_like, optional
**kwargs
|
|---|---|
| Returns: | y : ndarray or scalar
|
Examples
>>>np.fabs(-1)1.0>>>np.fabs([-1.2,1.2])array([ 1.2, 1.2])