numpy.setxor1d() function in Python Last Updated : 17 May, 2020 Comments Improve Suggest changes Like Article Like Report numpy.setxor1d() function find the set exclusive-or of two arrays and return the sorted, unique values that are in only one (not both) of the input arrays. Syntax : numpy.setxor1d(arr1, arr2, assume_unique = False) Parameters : arr1, arr2 : [array_like] Input arrays. assume_unique : [bool] If True, the input arrays are both assumed to be unique, which can speed up the calculation. Default is False. Return : [ndarray] Sorted 1D array of unique values that are in only one of the input arrays. Code #1 : Python3 # Python program explaining # numpy.setxor1d() function # importing numpy as geek import numpy as geek arr1 = [1, 2, 3, 4] arr2 = [2, 4, 6, 8] gfg = geek.setxor1d(arr1, arr2) print (gfg) Output : [1 3 6 8] Code #2 : Python3 # Python program explaining # numpy.setxor1d() function # importing numpy as geek import numpy as geek arr1 = [1, 2, 3, 4, 5] arr2 = [-2, -1, 0, 1, 2] gfg = geek.setxor1d(arr1, arr2) print (gfg) Output : [-2 -1 0 3 4 5] Comment More infoAdvertise with us Next Article numpy.setxor1d() function in Python S sanjoy_62 Follow Improve Article Tags : Machine Learning Python-numpy Python numpy-arrayManipulation python Practice Tags : Machine Learningpython Similar Reads numpy.bitwise_xor() in Python numpy.bitwise_xor() function is used to Compute the bit-wise XOR of two array element-wise. This function computes the bit-wise XOR of the underlying binary representation of the integers in the input arrays. Syntax : numpy.bitwise_xor(arr1, arr2, /, out=None, *, where=True, casting='same_kind', ord 2 min read numpy.logical_xor() in Python numpy.logical_xor(arr1, arr2, out=None, where = True, casting = 'same_kind', order = 'K', dtype = None, ufunc 'logical_xor') : This is a logical function and it helps user to find out the truth value of arr1 XOR arr2 element-wise. Both the arrays must be of same shape. Parameters : arr1 : [array_lik 2 min read ord() function in Python Python ord() function returns the Unicode code of a given single character. It is a modern encoding standard that aims to represent every character in every language.Unicode includes:ASCII characters (first 128 code points)Emojis, currency symbols, accented characters, etc.For example, unicode of 'A 2 min read numpy.frombuffer() function â Python numpy.frombuffer() function interpret a buffer as a 1-dimensional array. Syntax : numpy.frombuffer(buffer, dtype = float, count = -1, offset = 0) Parameters : buffer : [buffer_like] An object that exposes the buffer interface. dtype : [data-type, optional] Data-type of the returned array, default da 1 min read numpy.left_shift() in Python numpy.left_shift() function is used to Shift the bits of an integer to the left. The bits are shifted to the left by appending arr2 0s(zeroes) at the right of arr1. Since the internal representation of numbers is in binary format, this operation is equivalent to multiplying arr1 by 2**arr2. For exam 2 min read Like