[SciPy-user] Again on array manipulation

Lorenzo Isella lorenzo.isella@gmail....
Tue Jun 24 08:12:34 CDT 2008


Dear All,
This should be quick: say that you have e.g. the following two scipy
arrays:

a=[15 23 44 78|11 77| 33 45 89| 56 99| 12 654 81]

b=[10 10 10 10|40 40| 60 60 60| 22 22| 17 17 17]

(the vertical bar is just a guide for the eye).
No entry appears twice in a and no entry appears only once in b. I
would like to chop off all the
elements appearing more than twice in b and get rid of the
corresponding elements in a, thus ending up with:



a=[|11 77| 56 99|]

b=[|40 40| 22 22|]

what is the easiest way to achieve this?
Cheers

Lorenzo


More information about the SciPy-user mailing list