Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Is there any way to find the solutions of a set of non-linear complex equations in python?
I need to solve the Bethe equations of the heisenberg model (eg. equation 15 of http://arxiv.org/pdf/1201.5627v1.pdf)
SciPy includes nonlinear numerical solvers, but you may want to consider dedicated software, such as Wolfram Mathematica especially for computation speed considerations.
If the maths is the problem at some point, consider posting to the Math Stack Exchange website
You can use Sage. Sage notebook is the browser-based interface of Sage.
Most of the scientific/ Mathematical (SciPy,NumPy,Sympy...) python libraries are integrated with Sage so you do not have to call these libraries explicitly.
Related
Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 days ago.
Improve this question
I want to create below image distribution with n=10 in python code.
image
After searching on the Internet, the distribution most similar to this distribution is the binomial distribution, but the formula is different.
So, there are two things I want to ask you.
When n choose k, it should be written with nCk. Can I use n and k on the right side of C? (Even after searching for a combination, I couldn't find a case where it was written on the right side.)
Is there a distribution name for this formula?
thank you
After searching on the Internet, the distribution most similar to this distribution is the binomial distribution, but the formula is different.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I'm trying to get some approximation ratios for the Maximum Independent Set Problem and so I need some exact solutions !
I've found libraries written in C++ (i.e https://github.com/iPapatsoris/Maximum-Independent-Set)
but wondered if there were any directly in Python. I know of the `networkx' maximal indepedent set function but these are only approximations.
I realise it's far from the most efficient language to use but I'm only solving small Erdős–Rényi graphs (N<20).
In addition to this, are there any libraries that solve this for the weighted problem, where some nodes matter more than others?
This is the only python library I could find:
https://github.com/pchervi/Graph-Coloring/blob/master/Coloring_MWIS_heuristics.py
I haven't checked that it works correctly however.
I've been using KaMIS instead, which is a C++ implementation.
https://github.com/KarlsruheMIS/KaMIS
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I recently got interested in soccer statistics. Right now I want to implement the famous Dixon-Coles Model in Python 3.5 (paper-link).
The basic problem is, that from the model described in the paper a Likelihood function with numerous parameters results, which needs to be maximized.
For example: The likelihood function for one Bundesliga season would result in 37 parameters. Of course I do the minimization of the corresponding negative log-likelihood function. I know that this log function is strictly convex so the optimization should not be too difficult. I also included the analytic gradient, but as the number of parameters exceeds ~10 the optimization methods from the SciPy-Package fail (scipy.optimize.minimize()).
My question:
Which other optimization techniques are out there and are mostly suited for optimization problems involving ~40 independent parameters?
Some hints to other methods would be great!
You may want to have a look at convex optimization packages like https://cvxopt.org/ or https://www.cvxpy.org/. It's Python-based, hence easy to use!
You can make use of Metaheuristic algorithms which work both on convex and non-convex spaces. Probably the most famous one of them is Genetic algorithm. It is also easy to implement and the concept is straightforward. The beautiful thing about Genetic algorithm is that you can adapt it to solve most of the optimization problems.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm new to python. Now I have a dataframe which contain annual records from 1959 to 2009. Could you please tell me how to use it to predict, say from 2010 to 2012?
Appreciation for any help!
First of all, plot your data and have a look at it. You must then have a feeling of what's going on and also have a subjective prediction.
If your data seems to be completely random, without any obvious trends, calculate its average and use it as a first-guess prediction. (For a fully random data, it will be the result from the linear regression as well).
You can then use linear regression, either with Pandas' ols regression tools, or numpy's polyfit. Make sure you plot your data and the regression line to actually see how well your prediction is doing.
And don't expect to do a miracle with this method. Complicated things are much harder to predict than a linear regression, and 50-year-long processes, whatever they be, are usually complicated enough.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Is it possible to make 2D games using python? If it is got any links to any 2D game that used Python to create it? I was thinking of learning Python but thought i should ask you guys if it can create 2D games before I do start.
Yes, check out http://pygame.org
It's a pretty popular 2D library for Python.
I use pygame myself and it is very good. It has good documentation and tutorials, and is quite well designed. I've also heard wonderful reviews of pyglet.
Relevant