Skip to content
Snippets Groups Projects
Commit 2c10fd0a authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Added exist_all_elements_from_a_in_b().

parent e4089a0b
No related branches found
No related tags found
No related merge requests found
......@@ -421,6 +421,17 @@ def index_a_in_multi_b(a, b):
pass
return None
def exist_all_elements_from_a_in_b(a, b):
"""Return True if all elements in a are also in list b, else return False.
Both a and b can be a one dimensional list or a single object.
"""
for i in listify(a):
if i not in listify(b):
return False
return True
def find_indices_where(in_list, value, condition=operator.eq):
"""Return list of indices in in_list that match the condition value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment