Maybe I'm being slow, but is there any convenient function to calculate,
for 2 vectors:
\sum_i \sum_j x_i y_j
(I had a matrix once, but it vanished without a trace)
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
On Wed, Jun 20, 2012 at 3:58 PM, Neal Becker ndbeck...@gmail.com wrote:
Maybe I'm being slow, but is there any convenient function to calculate,
for 2 vectors:
\sum_i \sum_j x_i y_j
(I had a matrix once, but it vanished without a trace)
np.multiply.outer(x, y).sum()
--
Robert Kern
On Wed, Jun 20, 2012 at 8:58 AM, Neal Becker ndbeck...@gmail.com wrote:
Maybe I'm being slow, but is there any convenient function to calculate,
for 2 vectors:
\sum_i \sum_j x_i y_j
It factors, just do x.sum()*y.sum().
Chuck
___
NumPy-Discussion