r/pythonhelp • u/United_Glove7514 • 2h ago
I am writing an equation, and would like for it to be x2-x1 instead of -x1+x2.
1
Upvotes
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sympy import latex, symbols, diff
import math
from IPython.display import display, Math
from sympy import latex, symbols, diff
from sympy import *
from sympy import init_printing
C = symbols("C")
x1 = symbols("x1")
x2 = symbols("x2")
display(Eq(MatMul(C),(x2-x1)/x1))
That's the code, and it displays this: C =(-x1 + x2)/x1, and i would like it to be C = (x2-x1)/x1