[SciPy-User] Extracting common triplet from coordinate lists

alexander baker baker.alexander at gmail.com
Mon Sep 28 07:23:38 EDT 2009


You should be able to use orthogonality between same vectors in different
matrices to detect zero values in the arccos(A * transpose(B)) matrix and
distinct permutations there of.  (Make sure your norm each vector first in A
and B.)

Alex Baker

Mobile: 07788 872118
Blog: www.alexfb.com

--
All science is either physics or stamp collecting.


2009/9/28 David Warde-Farley <dwf at cs.toronto.edu>

> On 28-Sep-09, at 4:12 AM, Borís BURLE wrote:
>
> > In this example, I would like to extract the triplets (1,4,3) and
> > (3,2,1) since they are common to the three sets. As you can notice,
> > the
> > position of the common triplet is variable. In this example, data
> > are in
> > list, but any code working  on arrays would be ok for me too !!
>
> Easiest way I can think of:
>
> In [36]: set(zip(x1, y1, z1)) & set(zip(x2, y2, z2)) & set(zip(x3, y3,
> z3))
> Out[36]: set([(1, 4, 3), (3, 2, 1)])
>
> David
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20090928/aa0e3f78/attachment.html>


More information about the SciPy-User mailing list