Answers for "python get intersection of two arrays"

3

intersection in list

def intersection(lst1, lst2): 
    lst3 = [value for value in lst1 if value in lst2] 
    return lst3 
  
# Driver Code 
lst1 = [4, 9, 1, 17, 11, 26, 28, 54, 69] 
lst2 = [9, 9, 74, 21, 45, 11, 63, 28, 26] 
print(intersection(lst1, lst2))
Posted by: Guest on May-09-2020
1

intersection of lists in python

import numpy as np
recent_coding_books =  np.intersect1d(recent_books,coding_books)
Posted by: Guest on June-08-2020
1

intersection between two sets python

x = {"apple", "banana", "cherry"}
y = {"google", "microsoft", "apple"}

z = x.intersection(y)
    
print(z)

# Output: {"apple"}
Posted by: Guest on November-07-2020

Code answers related to "python get intersection of two arrays"

Python Answers by Framework

Browse Popular Code Answers by Language