Find elements in either array but not in both (exclusive OR).
Code
Generalset_a, set_b = set(arr1), set(arr2)
[x for x in arr1 if x not in set_b] + [x for x in arr2 if x not in set_a]Parameters
First array
Second array
Server
More Python Snippets
Array Difference
Find elements in the first array that are not present in the second array.
Array Frequencies
Count how many times each value appears in an array and return a frequency map.
Array Head
Get the first n elements of an array.
Array Intersection
Find common elements that exist in both arrays.
Array Tail
Get the last n elements of an array.
Array Union
Combine two arrays and remove duplicates to produce a union.