[Numpy-discussion] Re: broadcasting question

2023-03-23 Thread Neal Becker
On Thu, Mar 23, 2023 at 5:21 AM Sebastian Berg wrote: > On Wed, 2023-03-22 at 12:00 -0400, Robert Kern wrote: > > On Wed, Mar 22, 2023 at 9:34 AM Neal Becker > > wrote: > > > > > I have a function F > > > def F(a, b): > > > c = a * b > > > > > > Initially, a is a scalar, b[240,3000]. No

[Numpy-discussion] Re: broadcasting question

2023-03-23 Thread Sebastian Berg
On Wed, 2023-03-22 at 12:00 -0400, Robert Kern wrote: > On Wed, Mar 22, 2023 at 9:34 AM Neal Becker > wrote: > > > I have a function F > > def F(a, b): > >     c = a * b > > > > Initially, a is a scalar, b[240,3000].  No problem. > > Later I want to use F, where a[240] is a vector.  I want to

[Numpy-discussion] Re: broadcasting question

2023-03-22 Thread Robert Kern
On Wed, Mar 22, 2023 at 9:34 AM Neal Becker wrote: > I have a function F > def F(a, b): > c = a * b > > Initially, a is a scalar, b[240,3000]. No problem. > Later I want to use F, where a[240] is a vector. I want to allow both the > scalar and vector cases. So I write: > > def F(a,b): >