numpy.ldexp() in Python Last Updated : 22 Jul, 2021 Comments Improve Suggest changes Like Article Like Report In Python, numpy.ldexp(arr1, arr2[, out]) function returns arr1 * (2**arr2), element-wise. This is also called as inverse of numpy.frexp() function. Syntax: numpy.ldexp()Parameters: arr1: [array_like] Array of multipliers. arr2: [array_like, int] Array of twos exponents. out: [ndarray, optional] Output array for the result.Returns: [ndarray, scalar] Return the result of arr1 * (2**arr2). This is a scalar if both arr1 and arr2 are scalars. Code #1: Python3 # Python program explaining # numpy.ldexp() method # importing numpy import numpy as geek # ldexp() Function on + ve nd -ve Numbers print(geek.ldexp(6, geek.arange(4))) print(geek.ldexp(-8, geek.arange(4))) # ldexp() Function on fractional Number print(geek.ldexp(5.2, geek.arange(3))) print(geek.ldexp(-3.2, geek.arange(3))) Output: [ 6. 12. 24. 48.] [ -8. -16. -32. -64.] [ 5.2 10.4 20.8] [ -3.2 -6.4 -12.8] Code #2: Complex data-types are not supported, they will raise a TypeError. Python3 # Python program explaining # numpy.ldexp() method # importing numpy import numpy as geek # ldexp() Function on complex dtypes print(geek.ldexp(-5 + 9J, geek.arange(4))) Output: TypeError: ufunc 'ldexp' not supported for the input types Comment More infoAdvertise with us Next Article numpy.ldexp() in Python S sanjoy_62 Follow Improve Article Tags : Machine Learning Python-numpy python Practice Tags : Machine Learningpython Similar Reads numpy.mintypecode() function â Python numpy.mintypecode() function return the character for the minimum-size type to which given types can be safely cast. Syntax : numpy.mintypecode(typechars, typeset = 'GDFgdf', default = 'd') Parameters : typechars : [list of str or array_like] If a list of strings, each string should represent a dtyp 1 min read numpy.info() function in Python In Numpy we can get all the information about the function, class, or module like what will the parameter and what will be the type of the return value with the help of numpy.info() function. This function returns the help information for a function, class, or module. Syntax: numpy.info(numpy.info(o 1 min read Python | numpy.lookfor() method With the help of numpy.lookfor() method, we can get the information about the module in the numpy by using numpy.lookfor() method. Syntax : numpy.lookfor(module_name) Return : Return the information about the module. Example #1 : In this example we can see that by using numpy.lookfor() method, we ar 1 min read Numpy str_len() function numpy.char.str_len(arr) function is used for doing string operations in numpy. It returns the length of every string element wise. Parameters: arr : array_like of str or unicode.Input array. Returns : [ndarray] Output Array of integer. Code #1 : Python3 # Python program explaining # numpy.char.str_l 1 min read numpy.typename() function â Python numpy.typename() function return a description for the given data type code. Syntax : numpy.typename(char) Parameters : char : [str] Data type code. Return : [str] Description of the input data type code. Code #1 : Python3 # Python program explaining # numpy.typename() function # importing numpy as 2 min read Like