numpy.expm1(array, out = None, where = True, casting = ‘same_kind’, order = ‘K’, dtype = None) :
This mathematical function helps user to calculate exponential of all the elements subtracting 1 from all the input array elements.
array : [array_like]Input array or object whose elements, we need to test. out : [ndarray, optional]Output array with same dimensions as Input array, placed with result. **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.
An array with exponential(all elements of input array) - 1.
Code 1 : Working
Input array : [1, 3, 5] Exponential value of array element : [ 2.71828183 20.08553692 148.4131591 ] (Exponential value of array element) - (1) : [ 1.71828183 19.08553692 147.4131591 ]
Code 2 : Graphical representation
out_array : [ 1.71828183 2.32011692 3.05519997 3.95303242 5.04964746 6.3890561 ]
- Python | Merge Python key values to list
- Reading Python File-Like Objects from C | Python
- Python | Index of Non-Zero elements in Python list
- Important differences between Python 2.x and Python 3.x with examples
- Python | Add Logging to Python Libraries
- Python | Add Logging to a Python Script
- Python | Set 4 (Dictionary, Keywords in Python)
- Python | Sort Python Dictionaries by Key or Value
- chr() in Python
- Any & All in Python
- Python vs PHP
- SHA in Python
- Python | a += b is not always a = a + b
- Use of min() and max() in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.