Using arrays with other arrays in Python.

Posted by Scott on Stack Overflow See other posts from Stack Overflow or by Scott
Published on 2010-04-24T22:47:35Z Indexed on 2010/04/24 22:53 UTC
Read the original article Hit count: 313

Filed under:
|
|

Trying to find an efficient way to extract all instances of items in an array out of another.

For example

array1 = ["abc", "def", "ghi", "jkl"]

array2 = ["abc", "ghi", "456", "789"]

Array 1 is an array of items that need to be extracted out of array 2. Thus, array 2 should be modified to ["456", "789"]

I know how to do this, but no in an efficient manner.

© Stack Overflow or respective owner

Related posts about array

Related posts about python