I want to define sympy symbols such that when I display them I get a bar on them. I tried the following one: I then try to display it:display(alpha ...

How to add a bar on a sympy symbol?

I want to define sympy symbols such that when I display them I get a bar on them. I tried the following one: I then try to display it:display(alpha ...

sympy solve( ) with complex numbers

I have a hard time getting sympy to work with complex numbers. Take the following example: This, however, only finds 0<=x<1. It misses the n ...

How do you reduce compound inequalities in sympy? (4 < x - 8 < 10)

Using sympy solve() or reduce_inequalities() works fine for non compound inequalities like 2 - 6 * x <= -4 but it cannot do compound ones. Is ther ...

how do i typeshift <class 'sympy.sets.sets.FiniteSet'> to int

I want to typeshift a value from a sympy solveset to be an int. I try this: I get this error: my desired result is for this code to just make a ...

Sympy subs does not working for subexpression. Is there a way to solve this?

subs (from sympy library in Python) does not replace a subexpression in all cases except simple ones. MATLAB copes with this task perfectly. Is it pos ...

Curve translation in Python does not reach expected value

Suppose I have two curves, f(x) and g(x), and I want to evaluate if g(x) is a translation of f(x). I used Sympy Curve to do the job with the function ...

Python Sympy - Select monomials from ANF of Boolean expression

I have some truth table in GF(2) and I compute the corresponding Algebraic Normal Form (ANF) or Zhegalkin polynomial. Below a dummy example with two v ...

Substituing equation on Sympy

I'm trying to make an substitution of an equation to another, to reduce the variables. Ex: Give me an error: But if I rewrite the equation on s ...

Use `sympy.Order` with functions, instead of symbols

I have a problem like this f(u(x,y), v(x,y)) = 0. For a simple example we could choose f=u^2*v. I want to perturb the state with u=u_0+du,v=v_0+dv. Ju ...

Using sympy to rearrange equation?

Im trying to rearrange a supply curve equation for calculation the price elasticy. The equation is log P = -2 + 1.7 * log Q. Im trying to rearrange ...

Anyway to get rid of `math.floor` for positive odd integers with `sympy.simplify`?

I'm trying to simplify some expressions of positive odd integers with sympy. But sympy refuses to expand floor, making the simplification hard to proc ...

Sympy: Is there a function that gives all the factors of an expression but does not work sums?

I have an expression which is composed only of factors (e.g. (x**2+1)*(x**2)*(x+4). I want to delete the factor x**2 from it using the function .args ...

How can I get a list of the matrix symbols in a sympy expression?

Following this similar question I tried to retrieve the symbols of an expression containing matrix symbolic elements, without success: How can I ob ...

Distribute a sales value to four different values in python

I have a sales data for few years, I want to distribute data for few quarters. I can simply divide a that sales number over four quarters, but I would ...

How to create a looping function displaying whether number is odd or even in Sympy?

I wanted to create a loop dependent on the value of one variable, whether it is odd or even, but the code displays an error. The idea is that if 'coun ...

Issue while converting text/string into sympy math expression using sympify or parse_expr

I want my Python program to take text/string containing math formula/expression as input and convert it into latex format so that it can print/display ...

How can I write Collatz conjecture by SymPy?

I was going to write a SymPy function which takes a natural number and returns the step number of Collatz conjecture of the arg. The Python version is ...

Spurious exponents in sympy expressions

I build sp expressions (import sympy as sp) by multiplying / dividing others. Sometimes I find results like (expr1) while the correct expression is ...

Sympy: Is it possible use function collect() to IndexedBase variables?

I'm trying to use the function collect() to simplify mi expression . My desired result is My code: : My solution attempt: : What I'm doing w ...

Want to find the row operations when inverting a matrix

I have a sequence of matrices and I want to find the inverse of each one. I suspect that there is a pattern to the row operations when putting it into ...

Sorted:

Quality: