[Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors
mistersheik at gmail.com
Thu Apr 16 18:38:09 EDT 2015
On Thu, Apr 16, 2015 at 6:32 PM, Nathaniel Smith <njs at pobox.com> wrote:
> On Thu, Apr 16, 2015 at 6:19 PM, Neil Girdhar <mistersheik at gmail.com>
> > 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?
> Yes. Generally what we do is more important than what we say we do.
> Changing behaviour can break code. Changing docs can change whose
> "fault" this is, but broken code is still broken code. And if you put
> on your user hat, what do you do when numpy acts weird -- shake your
> fist at the heavens and give up, or sigh and update your code to
> match? It's pretty common for even undocumented behaviour to still be
> depended on.
> Also FWIW, np.outer's docstring says "Input is flattened if not
> already 1-dimensional", so we actually did document this.
Ah, yeah, somehow I missed that!
> Nathaniel J. Smith -- http://vorpus.org
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion