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

josef.pktd at gmail.com josef.pktd at gmail.com
Wed Apr 15 17:29:05 EDT 2015


On Wed, Apr 15, 2015 at 7:35 AM, Neil Girdhar <mistersheik at gmail.com> wrote:
> Yes, I totally agree.  If I get started on the PR to deprecate np.outer,
> maybe I can do it as part of the same PR?
>
> On Wed, Apr 15, 2015 at 4:32 AM, Sebastian Berg <sebastian at sipsolutions.net>
> wrote:
>>
>> Just a general thing, if someone has a few minutes, I think it would
>> make sense to add the ufunc.reduce thing to all of these functions at
>> least in the "See Also" or "Notes" section in the documentation.
>>
>> These special attributes are not that well known, and I think that might
>> be a nice way to make it easier to find.
>>
>> - Sebastian
>>
>> On Di, 2015-04-14 at 22:18 -0400, Nathaniel Smith wrote:
>> > I am, yes.
>> >
>> > On Apr 14, 2015 9:17 PM, "Neil Girdhar" <mistersheik at gmail.com> wrote:
>> >         Ok, I didn't know that.  Are you at pycon by any chance?
>> >
>> >         On Tue, Apr 14, 2015 at 7:16 PM, Nathaniel Smith
>> >         <njs at pobox.com> wrote:
>> >                 On Tue, Apr 14, 2015 at 3:48 PM, Neil Girdhar
>> >                 <mistersheik at gmail.com> wrote:
>> >                 > Yes, I totally agree with you regarding np.sum and
>> >                 np.product, which is why
>> >                 > I didn't suggest np.add.reduce, np.multiply.reduce.
>> >                 I wasn't sure whether
>> >                 > cumsum and cumprod might be on the line in your
>> >                 judgment.
>> >
>> >                 Ah, I see. I think we should treat them the same for
>> >                 now -- all the
>> >                 comments I made apply to a lesser or greater extent
>> >                 (in particular,
>> >                 cumsum and cumprod both do the thing where they
>> >                 dispatch to .cumsum()
>> >                 .cumprod() method).
>> >
>> >                 -n
>> >
>> >                 --
>> >                 Nathaniel J. Smith -- http://vorpus.org
>> >                 _______________________________________________
>> >                 NumPy-Discussion mailing list
>> >                 NumPy-Discussion at scipy.org
>> >                 http://mail.scipy.org/mailman/listinfo/numpy-discussion
>> >
>> >
>> >
>> >
>> >         _______________________________________________
>> >         NumPy-Discussion mailing list
>> >         NumPy-Discussion at scipy.org
>> >         http://mail.scipy.org/mailman/listinfo/numpy-discussion
>> >
>> > _______________________________________________
>> > NumPy-Discussion mailing list
>> > NumPy-Discussion at scipy.org
>> > http://mail.scipy.org/mailman/listinfo/numpy-discussion
>>
>>
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion at scipy.org
>> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>>
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>


I'm just looking at this thread.

I see outer used quite often

corrcoef = cov / np.outer(std, std)

(even I use it sometimes instead of
cov / std[:,None] / std

Josef



More information about the NumPy-Discussion mailing list