numpy.real_if_close() function - Python Last Updated : 11 Jun, 2020 Comments Improve Suggest changes Like Article Like Report In this numpy.real_if_close()function, if complex input returns a real array then complex parts are close to zero. Syntax : numpy.real_if_close(arr, tol = 100) Parameters : arr : [array_like] Input array. tol : [float] “Close to zero” is defined as tol. Tolerance in machine epsilons for the complex part of the elements in the array. Return : [ndarray] If arr is real, the type of arr is used for the output. If arr has complex elements, the returned type is float. Code #1 : Python3 # Python program explaining # numpy.real_if_close() function # importing numpy as geek import numpy as geek arr = [3.6 + 4e-14j] tol = 1000 gfg = geek.real_if_close(arr, tol) print (gfg) Output : [3.6] Code #2 : Python3 # Python program explaining # numpy.real_if_close() function # importing numpy as geek import numpy as geek arr = [3.6 + 2e-11j] tol = 1000 gfg = geek.real_if_close(arr, tol) print (gfg) Output : [3.6+2.e-11j] Comment More infoAdvertise with us Next Article numpy.real_if_close() function - Python sanjoy_62 Follow Improve Article Tags : Python Python-numpy Practice Tags : python Similar Reads numpy.real() function - Python numpy.real() function return the real part of the complex argument. Syntax : numpy.real(arr) Parameters : arr : [array_like] Input array. Return : [ndarray or scalar] The real component of the complex argument. If val is real, the type of val is used for the output. If val has complex elements, the 1 min read numpy.ma.allclose() function - Python numpy.ma.allclose() function returns True if two arrays are element-wise equal within a tolerance. This function is equivalent to allclose except that masked values are treated as equal (default) or unequal, depending on the masked_equal argument. Syntax : numpy.ma.allclose(a, b, masked_equal = True 2 min read __closure__ magic function in Python Almost everything in Python is an object, similarly function is an object too and all the function objects have a __closure__ attribute. __closure__ is a dunder/magic function i.e. methods having two underscores as prefix and suffix in the method name A closure is a function object that remembers va 1 min read numpy.allclose() in Python numpy.allclose() function is used to find if two arrays are element-wise equal within a tolerance. The tolerance values are positive, typically very small numbers. The relative difference (rtol * abs(arr2)) and the absolute difference atol are added together to compare against the absolute differenc 4 min read numpy.issubclass_() function â Python numpy.issubclass_() function is used to determine whether a class is a subclass of a second class. Syntax : numpy.issubclass_(arg1, arg2) Parameters : arg1 : [class] Input class. True is returned if arg1 is a subclass of arg2. arg2 : [class or tuple of classes] Input class. If a tuple of classes, Tr 1 min read round() function in Python Python round() function is a built-in function available with Python. It will return you a float number that will be rounded to the decimal places which are given as input. If the decimal places to be rounded are not specified, it is considered as 0, and it will round to the nearest integer. In this 6 min read wxPython | Exit() function in wxPython In this article we are going to learn about wx.Exit() which is a inbuilt parent function present in wxPython.Exit() function exits application after calling wx.App.OnExit . Should only be used in an emergency: normally the top-level frame should be deleted (after deleting all other frames) to termin 1 min read Python | Numpy ndarray.real() With the help of Numpy ndarray.real() method, we can find the real values in an imaginary expressions by just using ndarray.real() method. Remember resulting data type for the real value is 'float64'. Syntax : ndarray.real() Return : Array of Real values having dtype 'float64' Example #1 : In this e 1 min read How to Break a Function in Python? In Python, breaking a function allows us to exit from loops within the function. With the help of the return statement and the break keyword, we can control the flow of the loop.Using return keywordThis statement immediately terminates a function and optionally returns a value. Once return is execut 2 min read pandas.isna() function in Python This method is used to detect missing values for an array-like object. This function takes a scalar or array-like object and indicates whether values are missing (``NaN`` in numeric arrays, ``None`` or ``NaN`` in object arrays, ``NaT`` in datetimelike). Syntax : pandas.isna(obj) Argument : obj : sca 1 min read Like