[SciPy-user] intersect (matlab)

Bernardo M. Rocha bernardo.rocha@meduni-graz...
Thu Feb 12 01:23:44 CST 2009


Hi Guys,

Is there an equivalent in scipy/numpy to the following MATLAB code??? Or 
is there a way to do the same and get this ia and ib?

A = [1 2 3 6]; B = [1 2 3 4 6 10 20];
[c, ia, ib] = intersect(A, B);
disp([c; ia; ib])     1     2     3     6
    1     2     3     4
    1     2     3     5


Best regards.
Bernardo M. Rocha


More information about the SciPy-user mailing list