Relative Content

Tag Archive for pythonsympy

Changing the arguments when substituting a function

After a page of sympy manipulations I get and expression involving LambertW, but the answer given is for the zeroth branch cut. I can tell that I wanted the -1 branch. So, I’d like to change every occurrence of LambertW(y) into LambertW(y, -1).real, where y is an arbitrary sympy expression (that is different in each instance), in a set of expressions that are large enough so that doing it by hand is error prone.

sympy matrix scientific notation

I’m trying to display a sympy matrix in scientific notation, and it is only working for values less than 1. I can’t understand why applyfunc is behaving differently. Is there a better way to do this?

sympy matrix scientific notation

I’m trying to display a sympy matrix in scientific notation, and it is only working for values less than 1. I can’t understand why applyfunc is behaving differently. Is there a better way to do this?