[Numpy-discussion] sum of two arrays with different shape?

Robert Kern robert.kern at gmail.com
Mon Dec 18 20:03:00 CST 2006


zhang yunfeng wrote:
> Yes, It seems  powerful. But If
> one happened  to add two incompatible array by
> mistake,  Does the result make sense?

It may. The array object can't read your mind and know that you didn't intend it
to do what you (accidentally) told it to do.

> May be the broadcast feature
> should be limited in a certain range not to mess normal operation.

Broadcasting is really a fundamental feature of numpy. It *is* normal operation
as much as anything else is.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


More information about the Numpy-discussion mailing list