About 51 results
Open links in new tab
  1. python - What is the difference between math.exp and numpy.exp and …

    Feb 26, 2023 · math.exp works on a single number, the numpy version works on numpy arrays and is tremendously faster due to the benefits of vectorization. The exp function isn't alone in this - several …

  2. python - When to use math.exp versus np.exp - Stack Overflow

    Mar 31, 2021 · I'm wondering when is it appropriate to use math.exp versus np.exp? In general, when can and should one use methods from the math module versus numpy during vectorization …

  3. python - How can I use "e" (Euler's number) and power operation ...

    Aug 25, 2016 · How can I write 1-e^ (-value1^2/2*value2^2) in Python? I don't know how to use power operator and e.

  4. python - Difference between math.exp (2) and math.e**2 - Stack …

    Jun 10, 2015 · While programming I noticed a difference between the result of math.exp (2) and math.e**2. As you can see below, this difference does not arise when calculating e^1.

  5. python - What exactly does numpy.exp () do? - Stack Overflow

    Aug 11, 2015 · I'm very confused as to what np.exp() actually does. In the documentation it says that it: "Calculates the exponential of all elements in the input array." I'm confused as to what exactly this …

  6. Exponentials in python: x**y vs math.pow(x, y) - Stack Overflow

    Jan 7, 2014 · Exponentials in python: x**y vs math.pow (x, y) Asked 12 years ago Modified 5 months ago Viewed 131k times

  7. Python: OverflowError: math range error - Stack Overflow

    Oct 29, 2010 · The number you're asking math.exp to calculate has, in decimal, over 110,000 digits. That's slightly outside of the range of a double, so it causes an overflow.

  8. python - Overflow / math range error for log or exp - Stack Overflow

    Mar 29, 2016 · return 1/(1 + math.exp(-gamma)) The math range error is likely because your gamma argument is a large negative value, so you are calling exp() with a large positive value.

  9. math - Can i calculate exp (1+2j) in python? - Stack Overflow

    Dec 14, 2011 · Can i calculate exp (1+2j) in python? Asked 14 years, 1 month ago Modified 1 year, 7 months ago Viewed 28k times

  10. How to calculate a logistic sigmoid function in Python?

    Oct 21, 2010 · Using math.exp with numpy array can yield some errors, like: TypeError: only length-1 arrays can be converted to Python scalars. To avoid it you should use numpy.exp.