[Numpy-discussion] Detect subclass of ndarray

Charles R Harris charlesr.harris@gmail....
Sat Mar 24 12:36:33 CDT 2007


On 3/24/07, Alan G Isaac <aisaac@american.edu> wrote:
>
> On Sat, 24 Mar 2007, Charles R Harris apparently wrote:
> > I think it is reasonable to raise an exception in this
> > case, but that is not how numpy currently works, so it is
> > a larger policy decision that I can't make on my own. For
> > the case under consideration it is possible to define 1-D
> > to 2-D rules that are consistent and work, so I am
> > thinking of adding those to the __mul__ operator of the
> > matrix class. However, as you say, such rules are more
> > likely to let some errors slip by. In essence, it is
> > rather like type conversion in mixed expressions:
> > convenient, but open to error.
>
>
> Your proposed change is also not how numpy currently works.


True, numpy currently returns an incorrect result. We can either fix that,
or we can disallow 1-D vectors in matrix computations. But I hesitate to do
the latter without discussion and agreement on the list.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070324/c593375a/attachment.html 


More information about the Numpy-discussion mailing list