Ich habe ein Problem mit Sympy und komme nicht weiter. Das eigentlich ganz einfache Problem scheint dann doch nicht so einfach. Ich will das gleiche tun wie in dem folgenden Post hier. Leider Funktioniert BlackJacks Code in meinem Interpreter und in der Sympy Live Demo nicht mehr.
Im Sympy Tutorial konnte ich nichts finden dazu und nach 2Stunden frustet mich die Modul Referenz einfach nur.
Hat jmd einen Tipp für mich, andernfalls muss ich mein Problem morgen nochmal gründlich angehen.
mfG Lars
Code: Alles auswählen
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)]
In [1]: import sympy
In [2]: sympy.__version__
Out[2]: '0.7.1'
In [3]: x = sympy.Symbol("x")
In [4]: f = 2 * x + 4
In [5]: f(x=2)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-5-7e38344341de> in <module>()
----> 1 f(x=2)
TypeError: 'Add' object is not callable
In [6]: f({x:2})
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-6-8d71c040b250> in <module>()
----> 1 f({x:2})
TypeError: 'Add' object is not callable
In [7]: