how to solve a determinant in symengine (python) explicitely with the berkovitz algorithm - calc

I would like to replace an existing sympy code with symengine and I would need to replace the determinant calculation (method=berkovitz) with symengine. Is it possible to select this method explicitely with symengine in python? I saw it in the c++ code but I do not know how to use it in the python environment. I am using the latest symengine version (v0.9.2).
I looked into the testcases for matrices but could not find an example. I just wonder because the method is mentioned in the c++ code of symengine and I thought it should also work from python.
Thanks for any hint.

Related

Objective LOLCODE interpreter with STDLIB

I want to code a pi approximation that uses random numbers in LOLCODE.
Therefore I need the STDLIB to import a random number generator via:
CAN HAZ STDLIB?
The only interpreter repository for LOLCODE I've found was this.
It's not up to date and the links do not work so I don't know if the STDLIB is implemented.
Can somebody help me and link an Objective LOLCODE interpreter with working rng?

Acess the SDPA-GMP solver from mpmath

I do have code in mpmath that does the main part of what i do, except soling a semidefinite programming in arbitrary precision.
For that, i might be able to use SDPA-GMP, a C++ piece of software that solves a SDP in arbitrary precision using GMP as base arbitrary precision library.
Do you know if there are possibilities to call this from python ? On the over hand, is there somewhere a converter that passed from mpmath objcts to gmp ?
You might have found a solution but here is one: you can use the interface PICOS, save the problem with the extension 'dat-s' and then feed that to SDPA-GMP. This works perfectly and it's rather easy to use.

Line search method of scipy optimize minimize function

I am conducting research on optimization using scipy library, and have a question regarding with default line search method implemented in this library. I would like to write a description of the optimization method including what kind of line search method was applied. I run the optimization code using default options (BFGS) with unconstrained nonlinear objective function. Anyone who knows if scipy minimize function uses wolfe line search as a default? Thanks in advance!
Looking at the source code reveals that they use the _line_search_wolfe12 function. So yes, it uses Wolfe line search.

How to retrieve help for Pandas methods using '??'

I am new to Pandas, trying to learn the basics from lecture videos. In one of these the presenter demonstrates that one can call help on methods using ??.
For example if I have loaded a dataframe df then typing df.getitem?? should print the docstring as well as the source code to the console. This would be really great to have but it doesn't work for me! I tried different variants of the command and also tried to find a comment online on this, without success.
What do I need to type in order to retrieve the docstring as well as the source code of a Pandas method? Thanks a lot for your help !
(I am using Python 3.5 and PyCharm in case that makes a difference)
I believe that your lecturer was using ipython as this does support dynamic object information. For instance this is the output in ipython when you do df.__getitem__?? you see the following:
I strongly recommend ipython for interactive python development, you'll find a lot of devs using this for data exploration and analysis, the workbook is really useful for saving your commands and the output

User-specified function in mpfit

I have been an IDL programmer for sometime now and looking to transition to Python. I find that MPFIT's IDL version exists in Python. However, I am looking for MPFITFUN version in Python (http://www.physics.wisc.edu/~craigm/idl/down/mpfitfun.pro) or something similar.
Basically, I am looking for a Python function that takes a user-defined function and uses like Levenberg-Marquardt least-squared fit (like MPFIT).
Thanks,
There are fitting functions built into SciPy but I do not know of any which account for uncertainties in data as MPFITFUN does.
I have found Sherpa to be an excellent modeling and fitting package for Python which accounts for uncertainties and replaces MPFITFUN: http://cxc.harvard.edu/contrib/sherpa/
Since Sherpa is produced by astronomers it has a lot of built in astrophysical models, but you can build your own function to fit with Sherpa's Levenberg-Marquardt, Nelder-Mead or Monte Carlo algorithms. I used the template from the pysherpa blog:
http://pysherpa.blogspot.com/2010/06/user-defined-sherpa-model-types-using.html
mpfit.py is available from https://code.google.com/p/astrolibpy/ and an older version hosted at http://cars.uchicago.edu/software/python/mpfit.html.
A good alternative is lmfit: https://pypi.python.org/pypi/lmfit/, https://github.com/lmfit/lmfit-py, http://lmfit.github.io//lmfit-py/
I accidentally found that there also exists the MPFITEXPR in Python. Here's the link to the code. You can also download it via Astrolibpy project.
Link:
https://code.google.com/p/astrolibpy/source/browse/mpfit/mpfitexpr.py?r=3545675a0662392e3e09c88beaf275c9e7881cf6