我正在使用 Python35测试https://zulko.wordpress.com/2012/04/15/symbolic-matrix-differentiation-with-sympy/并且出现此错误:
Traceback (most recent call last):
File "D:\Program Files\JetBrains\PyCharm 2016.1\helpers\pydev\pydev_run_in_console.py", line 71, in <module>
globals = run_file(file, None, None)
File "D:\Program Files\JetBrains\PyCharm 2016.1\helpers\pydev\pydev_run_in_console.py", line 31, in run_file
pydev_imports.execfile(file, globals, locals) # execute the script
File "D:\Program Files\JetBrains\PyCharm 2016.1\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:/programs/python/wcf/test2/my.py", line 134, in <module>
matPrint( expand( expand( matDiff(H,X) ) ) )
File "D:/programs/python/wcf/test2/my.py", line 64, in matDiff
return MATRIX_DIFF_RULES[expr.__class__](expr,symbols)
File "D:/programs/python/wcf/test2/my.py", line 54, in <lambda>
Mul : lambda e,s : Mul(matDiff(e.args[0],s),Mul(*e.args[1:]))
File "D:/programs/python/wcf/test2/my.py", line 64, in matDiff
return MATRIX_DIFF_RULES[expr.__class__](expr,symbols)
File "D:/programs/python/wcf/test2/my.py", line 52, in <lambda>
Symbol : lambda e, s: d(e) if (e in s) else 0,
TypeError: argument of type 'Symbol' is not iterable