Sun Feb 4 19:12:44 CST 2007
Keith Goodman wrote:
> There's a numpy.abs but no numpy.matlib.abs.
>>> import numpy as N
>>> import numpy.matlib as M
> Type: ufunc
> Base Class: <type 'numpy.ufunc'>
> String Form: <ufunc 'absolute'>
> Namespace: Interactive
> y = absolute(x) takes |x| elementwise.
> Object `M.abs` not found.
numpy.abs() is not exported via "from numpy import *", which is where
numpy.matlib gets all of its non-overridden functions from. It is not exported
because it conflicts with the builtin abs().
Of course, absolute() is preferred for the same reason, and
numpy.matlib.absolute() does exist.
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
More information about the Numpy-discussion