Q:

Write a NumPy program to compute ex, element-wise of a given array

0

Write a NumPy program to compute ex, element-wise of a given array.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import numpy as np
x = np.array([1., 2., 3., 4.], np.float32)
print("Original array: ")
print(x)
print("\ne^x, element-wise of the said:")
r = np.exp(x)
print(r)
Sample Output:
Original array: 
[1. 2. 3. 4.]

e^x, element-wise of the said:
[ 2.7182817  7.389056  20.085537  54.59815  ]

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now