I guess your problem occurs because some NumPy functions explicitly require float
-type arguments. Your code np.exp(test)
, however, has type int
.
Try forcing it to be float
import numpy as np
your_array = your_array.astype(float)
output = np.exp(your_array)
# OR
def exp_test(x)
x.astype(float)
return np.exp(x)
output = exp_test(your_array)