[SciPy-user] can basearray using somehow be tried already?

Robert Kern robert.kern@gmail....
Fri Mar 23 15:20:16 CDT 2007

dmitrey wrote:
> Ok, but isn't it possible to add derive class to numpy, based on 
> ndarray, with MATLAB-like dotwise & matrix operations with any of 
> ndarray & matrix instances? I.e. x*y (x^y, x/y etc) is matrix & x .* y 
> (x.^y, x./y etc) is dotwise, if any of x & y are something like mat_array?

You can't add new operators. You can only redefine the behavior of the existing
operators, and that's exactly what numpy.matrix does.

> Currently I use it in my code things like
>     def _matmult(self, x, y):
>         return asarray(x) ** asarray(y)
>     def _dotmult(self, x, y):
>         return asarray(x) * asarray(y)
>> See my response to that post for why it's not quite the
> project you think it is, why I think it is dead, and what is replacing it.
> Can't you give exact URL, please? I'm not familiar enough with mailing 
> lists interface & browsing so I can't find it by myself.


Robert Kern

"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 SciPy-user mailing list