[Numpy-discussion] discussion about array.resize() -- compare to numarray

Stefan van der Walt stefan at sun.ac.za
Mon Jan 8 16:12:04 EST 2007


On Mon, Jan 08, 2007 at 12:24:01PM -0800, Sebastian Haase wrote:
> On 1/8/07, Robert Kern <robert.kern at gmail.com> wrote:
> > Sebastian Haase wrote:
> >
> > > I would suggest treating this as a real bug!
> > > Then it could be fixed immediately.
> >
> > Deliberate design decisions don't turn into bugs just because you disagree with
> > them. Neither do those where the original decider now disagrees with them.
> >
> Please explain again what the original decision was based on.
> I remember that there was an effort at some point to make methods as
> functions more consistent.

In this case, I tend to agree that the behaviour is unexpected.  In
some cases, like with sort, however, I think the difference in
behaviour is useful:

In [1]: import numpy as N

In [2]: x = N.array([3,2,1,2])

In [3]: N.sort(x) # Don't tell Guido!
Out[3]: array([1, 2, 2, 3])

In [4]: x
Out[4]: array([3, 2, 1, 2])

In [5]: x.sort()

In [6]: x
Out[6]: array([1, 2, 2, 3])

Cheers
Stéfan



More information about the NumPy-Discussion mailing list