Ich habe eine Funktion von x
und y
. Ich möchte dies in eine Funktion von x[0]
bzw. x[1]
umwandeln (ersetzen). Wie geht es weiter?Wie ersetze ich x und y in einer Gleichung mit x [0] und x [1]?
import sympy as s
x,y = s.symbols('x,y')
def f(x,y):
return (-x + 67)**2/(y**2)
Anstelle von x, y tun x = list (s.symbols (x, y ') –
'g = lambda x: f. (X [0], x [1])', die Funktion 'g' ist, was Sie wollen.Es empfängt Argument' x', das ist eine Liste und gibt 'f (x [0], x [1])' – Ian
@ lan danke – Shareef