- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Return mantissa and exponent as a pair for a specific list element in Numpy

To return mantissa and exponent as a pair of a given list, use the index value in the **numpy.frexp()** method in Python Numpy. The out is 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. A tuple (possible only as a keyword argument) must have length equal to the number of outputs.

The condition is broadcast over the input. At locations where the condition is True, the out array will be set to the ufunc result. Elsewhere, the out array will retain its original value. Note that if an uninitialized out array is created via the default out=None, locations within it where the condition is False will remain uninitialized.

## Steps

At first, import the required library −

import numpy as np

Create a list −

myList = [55.8, 45.5, 166.8, -14.8, 78,6, -19.8]

Display the list −

print("List...\n", myList)

Length of the list −

print("\nList length...\n", len(myList))

Type of the list −

print("\nList type...\n", type(myList))

Return mantissa and exponent as a pair of a given list −

print("\nReturn mantissa and exponent as a pair of a given list...\n",np.frexp(myList))

To return mantissa and exponent as a pair of a given list, use the index value in the numpy.frexp() method in Python Numpy −

print("\nResult (specific element)...\n",np.frexp(myList[3]))

## Example

import numpy as np # Create a list myList = [55.8, 45.5, 166.8, -14.8, 78,6, -19.8] # Display the list print("List...\n", myList) # Length of the list print("\nList length...\n", len(myList)) # Type of the list print("\nList type...\n", type(myList)) # Return mantissa and exponent as a pair of a given list print("\nReturn mantissa and exponent as a pair of a given list...\n",np.frexp(myList)) # To return mantissa and exponent as a pair of a given list, use the index value in the numpy.frexp() method in Python Numpy print("\nResult (specific element)...\n",np.frexp(myList[3]))

## Output

List... [55.8, 45.5, 166.8, -14.8, 78, 6, -19.8] List length... 7 List type... <class 'list'> Return mantissa and exponent as a pair of a given list... (array([ 0.871875 , 0.7109375, 0.6515625, -0.925 , 0.609375 , 0.75 , -0.61875 ]), array([6, 6, 8, 4, 7, 3, 5], dtype=int32)) Result (specific element)... (-0.925, 4)

- Related Questions & Answers
- Return mantissa and exponent as a pair for a specific array element in Numpy
- Return mantissa and exponent as a pair for a specific tuple element in Numpy
- Return mantissa and exponent as a pair of a given list in Numpy
- Return mantissa and exponent as a pair of a given value in Numpy
- Return mantissa and exponent as a pair of a given array in Numpy
- Return mantissa and exponent as a pair of a given tuple in Numpy
- Return the ceil of a specific array element in Numpy
- Return the floor of a specific array element in Numpy
- Return the truncated value of a specific array element in Numpy
- Find a specific element in a C# List
- For each element in a Numpy array, return a copy with the leading characters removed in Numpy
- For each element in a Numpy array, return a copy with the leading and trailing characters removed
- Return a 1D version of self as a view in Numpy
- For each element in a Numpy array, return a copy with the leading spaces removed
- For each element in a Numpy array, return a copy with the trailing spaces removed