This is more of a math problem than anything else. Lets assume I have two lists of different sizes in Python
listA = ["Alice", "Bob", "Joe"]
listB = ["Joe", "Bob", "Alice", "Ken"]
I want to find out what percentage overlap these two lists have. Order is not important within the lists. Finding overlap is easy, I've seen other posts on how to do that but I can't quite extend it in my mind to finding out what percentage they overlap. If I compared the lists in different orders would the result come out differently? What would be the best way of doing this?
2*number of matches/(len(lista)+len(listb))
or something else – Horrible[1,1,1]
and[1]
. Would the overlap be 100% or 33%? – Punset()
will be very helpful), or about the percentage of ALL elements, including repeats, that the two lists share? – Mealtime