This is an archival dump of old wiki content --- see scipy.org for current material

Abstract

The returned array is the absolute values of the given array. An alias for absolute(arr) function

Signature


Function

abs(arr)


Returns

return
The returned array is the absolute values of the given array.

Arguments

arr
The given array.

Details

xxx

Examples

   1 >>> from numpy import *
   2 >>> abs(-1)
   3 1
   4 >>> abs(array([-1.2, 1.2]))
   5 array([ 1.2,  1.2])
   6 >>> abs(1.2+1j)
   7 1.5620499351813308

Notes

xxx

See Also

absolute : absolute() is an alias.

SciPy: abs (last edited 2015-10-24 17:48:24 by anonymous)