Is there a way I can calculate the Intersection of two lists that have duplicates in them. For example.
list1=[1,2,3,4,4,4,5]
list2=[4,4,5,5,6]
result would be:
[4,4,5]
I tried the intersection() function in pandas but that uses sets not lists