[Numpy-discussion] any better way to normalize a matrix

Christopher Barker Chris.Barker@noaa....
Fri Dec 28 18:57:42 CST 2007


Anne Archibald wrote:
> Numpy provides ufuncs as general powerful tools for operating on
> matrices. More can be added relatively easily, they provide not just
> the basic "apply" operation but also "outer" and others. Adding
> another way to accomplish the same operation just adds bulk to numpy.

Maybe so, but if it were up to me, I'd have just the methods, and not 
the functions -- I like namespaces and OO design. I've always thought it 
was a spurious argument that these kinds of functions can operate on 
things that aren't numpy arrays -- it's true, but they all return 
arrays, to it's not like they really are universal.

> Surely you don't want to see myarray.arctan()?

This was debated a fair bit on this list when the other methods were 
added. Personally, I like functions, rather than methods for things that 
"feel" like standard math -- trig functions, etc. I guess abs() kind of 
falls on the line.

All I know is that I expected abs()  to be a method this time.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@noaa.gov


More information about the Numpy-discussion mailing list