access individual elements from a list of pow and symbol sympy python -
i'm trying access individual elements in long list of symbols, , 1 of pow types generated using sympy, here how come out in console:
x00 x01 x10 x11 x00 x10 x20 x00 x01 x02 x03 x00 x01 x10 x02 x11 x12 x00 x01 x10 x11 x20 x21 x00 x10 x20 x30
the pow generated using
= (ymat[0])**(nvec[0]-mvec[0]) #alpha term: mu^(n-k) nv in range (1, nvariables): = a* (ymat[nv]**(nvec[nv]-mvec[nv]))
and symbols using:
mstr = str(mvec[0]) #beta term: x^k mm in range(1, len(mvec)): mstr = mstr + str(mvec[mm]) b = symbol('x'+mstr)
i've tried using indexation in python such a[1] error message:
typeerror: 'symbol' object not support indexing
or
typeerror: 'pow' object not support indexing
does know how access individual elements such (1x00)
symbols compare equal name (and assumptions, doesn't using those), recreate same symbol making 1 same name. if want x00
, create symbol('x00')
again, , give same thing.
Comments
Post a Comment