There is substantial programmer overhead involved in linking to a library function, especially if that library is new to the programmer. It is often simpler to just rewrite simple algorithms rather ...

Edit: This is now in SymPy \$ isympy In : A = MatrixSymbol('A', n, n) In : B = MatrixSymbol('B', n, n) In : context = Q.symmetric(A) & Q.positive_definite(A) & Q.orthogonal(B) In : ...

You should check out sympy.stats. It provides an interface to deal with random variables. The following example provides a random variable X defined on the unit interval with density 2x In : from ...

Code generation and precompilation of mathematical expressions is becoming more popular. While symbolic packages like SymPy, Mathematica, and Maple may include code generation I'm not confident that ...

In the line Z = X You're just renaming X to Z, not making a copy. Your code then proceeds to zero out all elements of X. You might want to try replacing this with the following: Z = X.copy() ...

If running all your code is cheap then you could do something low-tech like the following: You could template your documents with formatted strings so that they look like this "we observed a %(...

You could look into asymptotic behavior of discrete Dynamical Systems. There is both a rich theoretical literature on this topic in mathematics and more applied literature in physics and computer ...

SymPy is able to plot your piecewise function: from sympy import * x = Symbol('x') n = 2 # you have to choose some explicit number for n f = Piecewise((0, n<=x), (x-n, x<=n+1), (2-x+n, x<=n+...

The article you cite defends Gaussian Elimination by saying that even though it is numerically unstable it tends to do well on random matrices and since most matrices one can think of are like random ...

fwrap specifically targets Fortran90/95 and uses some of the same software stack as f2py.

I suspect that even the most well-thought out answers to this question will be obsolete in five to ten years. Given the uncertainty of future programming paradigms it may not be worthwhile to spend a ...