I really like the idea of the Wolfram Engine, and in particular using it via the python client library. However, I've having trouble understanding the syntax for even simple commands: is there some documentation anywhere (beyond the very limited reference docs)? In particular, is there documentation of the API and how standard commands from Mathematica map across?
The particular simple example I'm unable to get work is just a simple Sum
call. I expected this to be accessed via something like
from wolframclient.language import wl
wl.Sum(1, ['i', 1, 5])
but this gives a list of errors (Raw object i cannot be used as an iterator.
etc). How is it intended to use simple functions like this?
wlexpr('Sum[1, {i, 1, 5}]')
, which you can pass along tosession.evaluate()
? $\endgroup$wlexpr
will be just a bit more painful as everything's a string -- fine if that's the only option though! $\endgroup$Sum[1, {"i", 1, 5}]
. Maybe your'i'
is translated to a string, not aSymbol
. $\endgroup$wl.Sum(1, [wl.Symbol('i'), 1, 5])
gives a similar error (Tag Symbol in Symbol[i] is Protected
) - how are symbols treated by Mathematica when used as dummy variables? $\endgroup$