Yep. Thanks much, Sudhanshu Cheers, Scott On Tuesday, March 24, 2015 at 5:44:47 PM UTC-4, Sudhanshu Mishra wrote: > > Hi Scott, > > It looks like your subs call is wrong. It should be fn.subs(x, q0) > > Hope this helps. > > Sudhanshu Mishra > > On Wed, Mar 25, 2015 at 3:06 AM, Scott Guthery <[email protected] > <javascript:>> wrote: > >> Any insight into the following will be greatly appreciated. Many thanks. >> >> from sympy import * >> >> x = symbols('x', integer=True) >> >> def main(fns, q0): >> for fn in fns: >> print(fn) >> print(fn.subs([x,q0])) >> >> if __name__ == '__main__': >> f1=x >> f2=x+2 >> main([f1,f2], 3) >> >> yields >> >> x >> Traceback (most recent call last): >> File ".../Subs.py", line 13, in <module> >> main([f1,f2], 3) >> File ".../Subs.py", line 8, in main >> print(fn.subs([x,q0])) >> File "C:\Python34\lib\site-packages\sympy\core\basic.py", line 842, in >> subs >> o, n = sequence[i] >> TypeError: 'Symbol' object is not iterable >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sympy" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] <javascript:> >> . >> Visit this group at http://groups.google.com/group/sympy. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/sympy/b96b9f35-cd77-449a-bcf4-99668181633e%40googlegroups.com >> >> <https://groups.google.com/d/msgid/sympy/b96b9f35-cd77-449a-bcf4-99668181633e%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > >
-- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/e19f243c-a33f-41c4-a261-e1f5a111cfc3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
