[SciPy-dev] numpy.broadcast

David Goldsmith d_l_goldsmith@yahoo....
Wed Aug 5 14:38:19 CDT 2009


--- On Wed, 8/5/09, Robert Kern <robert.kern@gmail.com> wrote:

> wrote:
> > I guess I don't really understand this too well - is
> the below correct behavior, and if so, why?
> >
> >>>> b = np.broadcast(x, y, x, y)
> >>>> b.nd # doesn't return what I'd expect
> > 2

Why isn't that 4?

> Why don't you expect this? It's the correct answer.
> (x*y*x*y).shape == (3,3).
> 
> >>>> del b # maybe problem is that I have to
> "clear" b first?
> >>>> # or maybe it's that all args have to be
> different?
> > ...
> >>>> b = np.broadcast(x, y, x * y)
> >>>> b.nd
> > 2

Why isn't that 3?

If x0, ..., xN are the arguments to `broadcast` and D = max(x0.nd, ..., xN.nd), is broadcast.nd necessarily <= D?  If so, then I think I'm on the road to understanding.

DG


      


More information about the Scipy-dev mailing list