You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sympy
Hello,
I would like to modify a part of an expression so as to obtain: `EXPR.args[2].args[1] = MODIFIED_SUB_EXPRESSION`
How can I do this? The elements returned by "args" are immutable tuples, I cannot edit them in place and I don't know how to create a modified copy.
Thank you for your help,
Olivier
Chris Smith
unread,
Mar 11, 2022, 5:07:27 PM3/11/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sympy
This is what `epath` is made for, I believe. I have not spent enough time with it to provide much help, however -- only a pointer.
/c
Bla Binorbit
unread,
Mar 11, 2022, 7:39:01 PM3/11/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sympy
Thank you. I didn't know `epath()`. Indeed, the following command performs the desired modification: `epath("/[2]/[1]", EXPR, lambda expr: MODIFIED_SUB_EXPRESSION)` Best regards, Olivier