[Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors

Neil Girdhar mistersheik at gmail.com
Thu Apr 16 18:37:36 EDT 2015


That sounds good to me.

I can always put np.outer = np.multiply.outer at the start of my code to
get what I want.  Or could that break things?

On Thu, Apr 16, 2015 at 6:28 PM, Matthew Brett <matthew.brett at gmail.com>
wrote:

> Hi,
>
> On Thu, Apr 16, 2015 at 3:19 PM, Neil Girdhar <mistersheik at gmail.com>
> wrote:
> > Actually, looking at the docs, numpy.outer is *only* defined for 1-d
> > vectors.  Should anyone who used it with multi-dimensional arrays have an
> > expectation that it will keep working in the same way?
> >
> > On Thu, Apr 16, 2015 at 10:53 AM, Neil Girdhar <mistersheik at gmail.com>
> > wrote:
> >>
> >> Would it be possible to deprecate np.outer's usage on non
> one-dimensional
> >> vectors for a few versions, and then reintroduce it with definition
> np.outer
> >> == np.multiply.outer?
>
> I think the general idea is that
>
> a) people often miss deprecation warnings
> b) there is lots of legacy code out there, and
> c) it's very bad if legacy code silently gives different answers in
> newer numpy versions
> d) it's not so bad if newer numpy gives an intelligible error for code
> that used to work.
>
> So, how about a slight modification of your proposal?
>
> 1) Raise deprecation warning for np.outer for non 1D arrays for a few
> versions, with depraction in favor of np.multiply.outer, then
> 2) Raise error for np.outer on non 1D arrays
>
> Best,
>
> Matthew
> _______________________________________________
> 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/20150416/043c0b5b/attachment.html>


More information about the NumPy-Discussion mailing list