[Numpy-discussion] Broadcasting question

Charles R Harris charlesr.harris@gmail....
Thu Dec 4 10:55:26 CST 2008


On Thu, Dec 4, 2008 at 8:26 AM, Olivier Grisel <olivier.grisel@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://projects.scipy.org/pipermail/numpy-discussion/attachments/20081204/7b5fe67c/attachment.html 


More information about the Numpy-discussion mailing list