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

  • SEARCH
  • Home
  • 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 6219021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:42:29+00:00 2026-05-24T07:42:29+00:00

SciPy’s documentation on LeastSq is here . It states that ier is An integer

  • 0

SciPy’s documentation on LeastSq is here. It states that ier is

An integer flag. If it is equal to 1, 2, 3 or 4, the solution was found. Otherwise, the solution was not found. In either case, the optional output variable ‘mesg’ gives more information.

But how do I retrieve the optional variable mesg?

x,ier=leastsq(residuals, plsq, args=(x_vals, y_vals)) gives me only two returns while

x,mesg,ier=leastsq(residuals, plsq, args=(x_vals, y_vals)) gives the error message ValueError: need more than 2 values to unpack on that line.

  • 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-24T07:42:29+00:00Added an answer on May 24, 2026 at 7:42 am

    Use the full_output parameter:

    import scipy.optimize as optimize
    p,cov,infodict,mesg,ier = optimize.leastsq(
        residuals,p_guess,args=(x,y),full_output=True)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone tried compiling SciPy 0.7.1 on Windows using numpy-1.3.0 that was built with
i am using this: http://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html i have an list a that i want to
I use the latest version of numpy/scipy. The following script does not work: import
I face a problem in scipy 'leastsq' optimisation routine, if i execute the following
SciPy appears to provide most (but not all [1]) of NumPy's functions in its
Can I get the vaule of RMSE from scipy.optimize.leastsq module ?
Can you suggest a module function from numpy/scipy that can find local maxima/minima in
I have a moderately large piece (a few thousand lines) of Python/Numpy/Scipy code that
I saw this example in the SciPy documentation: x, y = np.random.multivariate_normal(mean, cov, 5000).T
I'm trying to get my Jacobian to work with SciPy's Optimize library's leastsq function.

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.