[Numpy-discussion] add .H attribute?

Ralf Gommers ralf.gommers at gmail.com
Sat Jul 20 09:49:34 EDT 2013


On Sat, Jul 20, 2013 at 3:30 PM, Sebastian Haase <seb.haase at gmail.com>wrote:

> On Sat, Jul 20, 2013 at 12:36 PM, Ralf Gommers <ralf.gommers at gmail.com>
> wrote:
> >
> >
> >
> >
> > On Thu, Jul 18, 2013 at 4:18 PM, Stéfan van der Walt <stefan at sun.ac.za>
> wrote:
> >>
> >> On Sat, Jul 13, 2013 at 7:46 PM, Nathaniel Smith <njs at pobox.com> wrote:
> >> > Why not just write
> >> >
> >> > def H(a):
> >> >     return a.conj().T
> >>
> >> It's hard to convince students that this is the Best Way of doing
> >> things in NumPy.  Why, they ask, can you do it using a' in MATLAB,
> >> then?
> >>
> >> I've tripped over this one before, since it's not the kind of thing
> >> you imagine would be unimplemented, and then spend some time trying to
> >> find it.
> >
> >
> > +1 for adding a H attribute.
> >
> > Here's the end of the old discussion Chuck referred to: >
> http://thread.gmane.org/gmane.comp.python.numeric.general/6637.  No
> strong arguments against and then
> > several more votes in favor.
>
> Are there other precedents where an attribute would involve
> data-copying ?


np.matrix.H for example. If you meant ndarray attributes and not attributes
of numpy objects, I guess no. I don't think that matters much compared to
having an intuitive and consistent API though.

Ralf



> I'm thinking that numpy generally does better than
> matlab by being more explicit about it's memory usage...
> (But, I'm no mathematician and I could see it beeing much of a
> convenience to have .H )
>
> My two cents,
> Sebastian Haase
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130720/1ef97f50/attachment.html>


More information about the NumPy-Discussion mailing list