[Numpy-discussion] Broadcasting question

Charles R Harris charlesr.harris at gmail.com
Thu Dec 4 11:55:26 EST 2008


On Thu, Dec 4, 2008 at 8:26 AM, Olivier Grisel <olivier.grisel at ensta.org>wrote:

> Hi list,
>
> Suppose I have array a with dimensions (d1, d3) and array b with
> dimensions (d2, d3). I want to compute array c with dimensions (d1,
> d2) holding the squared euclidian norms of vectors in a and b with
> size d3.
>

Just to clarify the problem a bit, it looks like you want to compute the
squared euclidean distance between every vector in a and every vector in b,
i.e., a distance matrix. Is that correct? Also, how big are d1,d2,d3?

If you *are* looking to compute the distance matrix I suspect your end goal
is something beyond that. Could you describe what you are trying to do? I
could be that scipy.spatial or scipy.cluster are what you should look at.

<snip>

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20081204/7b5fe67c/attachment.html>


More information about the NumPy-Discussion mailing list