728x90
extract values that isn't the same value, based on one list
def extract_value_in_list(ref, hyp):
r = set(ref)
h = set(hyp)
#extract value that is in ref but not in hyp
temp = [x for x in ref if x not in h]
return temp
ref = ['a','b','c','d']
hyp = ['b','c','e]
new_list = extract_value_in_list(ref, hyp)
print(new_list)
#output
['a','d']
ref value 값들을 대상으로 hyp 리스트에 공통 value를 뺀다.