**
labels = ['UNREAD', 'CATEGORY_PERSONAL', 'INBOX']
incomingLabels = ['UNREAD','IMPORTANT' 'CATEGORY_PERSONAL', 'INBOX']
**
labels array is static array. How do I check incoming array contains all elemnts of labels array.
My attempts
intersectionOfTwoArrays = list(set(incomingLabels) & set(labels))
if np.array_equal(labels, intersectionOfTwoArrays):
//Do somthing
that attempt not succed because intersectionOfTwoArrays's not ordered same as labels array
Can anyone help me on that?
set(incomingLabels) >= set(labels)? array_equal does an elementwise comparison. Are you actually using numpy arrays?