Evaluate multiple expressions against same dataset

26 views
Skip to first unread message

Sushant Sharma Chaudhary

unread,
Jun 7, 2022, 10:07:53 PM6/7/22
to sympy
Hi Everyone,

I have 9200 symbolic expressions i need to test against same data point. Is there a faster way to do this other than one at a time. 

The opposite 1 expression and N data points is easy using lambdify. 

I really need to boost the performance of my algorithm. Any suggestions will be helpful.

Sushant

Aaron Meurer

unread,
Jun 7, 2022, 10:11:56 PM6/7/22
to sy...@googlegroups.com
You can pass multiple expressions to lambdify at once if you pass them as a list. If you use cse=True the performance can be improved if the expressions have common subexpressions among them.

Other than that I would recommend doing this and using numba.njit() or numba.njit(parallel=True) on the lambdified function.

Aaron Meurer

--
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 sympy+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/ded04dff-4095-45ec-b1e6-9ec0b157f203n%40googlegroups.com.

Sushant Sharma Chaudhary

unread,
Jun 8, 2022, 10:31:26 AM6/8/22
to sympy
Thank you very much!
It really helped with the performance. Much appreciated.
Reply all
Reply to author
Forward
0 new messages