numpy.invert() in Python Last Updated : 29 Nov, 2018 Comments Improve Suggest changes Like Article Like Report numpy.invert() function is used to Compute the bit-wise Inversion of an array element-wise. It computes the bit-wise NOT of the underlying binary representation of the integers in the input arrays. For signed integer inputs, the two’s complement is returned. In a two’s-complement system negative numbers are represented by the two’s complement of the absolute value. Syntax : numpy.invert(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, ufunc ‘invert') Parameters : x : [array_like] Input array. out : [ndarray, optional] A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned. **kwargs : Allows you to pass keyword variable length of argument to a function. It is used when we want to handle named argument in a function. where : [array_like, optional] True value means to calculate the universal functions(ufunc) at that position, False value means to leave the value in the output alone. Return : [ndarray or scalar] Result. This is a scalar if x is scalar. Code #1 : Working Python # Python program explaining # invert() function import numpy as geek in_num = 10 print ("Input number : ", in_num) out_num = geek.invert(in_num) print ("inversion of 10 : ", out_num) Output : Input number : 10 inversion of 10 : -11 Code #2 : Python # Python program explaining # invert() function import numpy as geek in_arr = [2, 0, 25] print ("Input array : ", in_arr) out_arr = geek.invert(in_arr) print ("Output array after inversion: ", out_arr) Output : Input array : [2, 0, 25] Output array after inversion: [ -3 -1 -26] Code #3 : Python # Python program explaining # invert() function import numpy as geek in_arr = [True, False] print("Input array : ", in_arr) out_arr = geek.invert(in_arr) print ("Output array after inversion: ", out_arr) Output : Input array : [True, False] Output array after inversion: [False True] Comment More infoAdvertise with us Next Article numpy.invert() in Python jana_sayantan Follow Improve Article Tags : Python Python-numpy Python numpy-Binary Operation Practice Tags : python Similar Reads numpy.isnan() in Python The numpy.isnan() function tests element-wise whether it is NaN or not and returns the result as a boolean array. Syntax : numpy.isnan(array [, out]) Parameters : array : [array_like]Input array or object whose elements, we need to test for infinity out : [ndarray, optional]Output array placed wit 2 min read numpy.nonzero() in Python numpy.nonzero()function is used to Compute the indices of the elements that are non-zero. It returns a tuple of arrays, one for each dimension of arr, containing the indices of the non-zero elements in that dimension. The corresponding non-zero values in the array can be obtained with arr[nonzero(ar 2 min read numpy.isinf() in Python The numpy.isinf() function tests element-wise whether it is +ve or -ve infinity or not return the result as a boolean array. Syntax: numpy.isinf(array [, out]) Parameters :  array : [array_like]Input array or object whose elements, we need to test for infinity out : [ndarray, optional]Output array 2 min read numpy.negative() in Python numpy.negative() function is used when we want to compute the negative of array elements. It returns element-wise negative value of an array or negative value of a scalar. Syntax : numpy.negative(arr, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, ext 2 min read numpy.isneginf() in Python The numpy.isneginf() function tests element-wise whether it is negative infinity or not, and returns the result as a boolean array. Syntax :  numpy.isneginf(array, y = None) Parameters : array : [array_like]Input array or object whose elements, we need to test for infinity. y : [array_like]A boole 2 min read numpy.arcsin() in Python numpy.arcsin(x[, out]) = ufunc 'arcsin') : This mathematical function helps user to calculate inverse sine for all x(being the array elements). Parameters : array : [array_like]elements are in radians. out : [array_like]array of same shape as x. Return : An array with inverse sine of x for all x i.e 2 min read numpy.nanmin() in Python numpy.nanmin()function is used when to returns minimum value of an array or along any specific mentioned axis of the array, ignoring any Nan value. Syntax : numpy.nanmin(arr, axis=None, out=None) Parameters : arr :Input array. axis :Axis along which we want the min value. Otherwise, it will consider 2 min read numpy.flip() in Python The numpy.flip() function reverses the order of array elements along the specified axis, preserving the shape of the array. Syntax: numpy.flip(array, axis) Parameters : array : [array_like]Array to be input axis : [integer]axis along which array is reversed. Returns : reversed array with shape pr 1 min read numpy.isposinf() in Python The numpy.isposinf() function tests element-wise whether it is positive infinity or not and returns the result as a boolean array. Syntax : numpy.isposinf(array, y = None) Parameters:  array : [array_like]Input array or object whose elements, we need to test for infinity. y : [array_like]A boolea 2 min read numpy.multiply() in Python The numpy.multiply() is a numpy function in Python which is used to find element-wise multiplication of two arrays or scalar (single value). It returns the product of two input array element by element.Syntax:numpy.multiply(arr1, arr2, out=None, where=True, casting='same_kind', order='K', dtype=None 3 min read Like