[Numpy-discussion] round() and abs() Ufuncs???

Chris Barker chrishbarker at home.net
Wed Sep 26 12:00:02 CDT 2001


Chris Barker wrote:

> I was recently surprised to find that there are no round() or abs()
> Ufuncs with Numeric. I'm imagining that they might exist under other
> names, but if not, I submit my versions for critique (lightly tested)

OK, Tim Hochberg was nice enough to point out to me that abs() works on
NumPy arrays. However, it does not work on other sequences, so maybe we
need this:

def abs(a):
    return abs(asarray(a))

-Chris


-- 
Christopher Barker,
Ph.D.                                                           
ChrisHBarker at home.net                 ---           ---           ---
http://members.home.net/barkerlohmann ---@@       -----@@       -----@@
                                   ------@@@     ------@@@     ------@@@
Oil Spill Modeling                ------   @    ------   @   ------   @
Water Resources Engineering       -------      ---------     --------    
Coastal and Fluvial Hydrodynamics --------------------------------------
------------------------------------------------------------------------




More information about the Numpy-discussion mailing list