Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3450538
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:03:43+00:00 2026-05-18T09:03:43+00:00

What does the following error: Warning: overflow encountered in exp in scipy/numpy using Python

  • 0

What does the following error:

Warning: overflow encountered in exp

in scipy/numpy using Python generally mean? I’m computing a ratio in log form, i.e. log(a) + log(b) and then taking the exponent of the result, using exp, and using a sum with logsumexp, as follows:

c = log(a) + log(b)
c = c - logsumexp(c)

some values in the array b are intentionally set to 0. Their log will be -Inf.

What could be the cause of this warning? thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T09:03:44+00:00Added an answer on May 18, 2026 at 9:03 am

    In your case, it means that b is very small somewhere in your array, and you’re getting a number (a/b or exp(log(a) - log(b))) that is too large for whatever dtype (float32, float64, etc) the array you’re using to store the output is.

    Numpy can be configured to

    1. Ignore these sorts of errors,
    2. Print the error, but not raise a warning to stop the execution (the default)
    3. Log the error,
    4. Raise a warning
    5. Raise an error
    6. Call a user-defined function

    See numpy.seterr to control how it handles having under/overflows, etc in floating point arrays.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got the following error/warning while tring to install Kohana/SilverStripe. What does it mean
What does the following error mean? Geeneration of designer file failed: Exception from HRESULT:
In MySQL 5.0 why does the following error occur when trying to create a
I get the following error message in SQL Server 2005: User '<username>' does not
Why does the following code NOT give an error, nor any type of a
What does the following mean? Class.Function(variable := 1 + 1) What is this operator
Why does the following code sometimes causes an Exception with the contents CLIPBRD_E_CANT_OPEN: Clipboard.SetText(str);
Why does the following code not work as I was expecting? <?php $data =
Why does the following method hang? public void pipe(Reader in, Writer out) { CharBuffer
What does the following code do in C/C++? if (blah(), 5) { //do something

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.