On Wed, 17 Aug 2022 at 14:38, Zohreh Karimzadeh <z.karimza...@gmail.com> wrote:
>
> Dear sympy group
> Thanks for your sympy.
>
> I am working on a code, after creating my big expression using sympy it 
> includes sqrt.
>
> I need to lambdify my expression to make it consistent with numpy and other 
> suffs.
>
> expr =10 * sp.sqrt(sp.symbols('x'))
>
> model_func = sp.lambdify('x', expr)
>
> But I found my expression after lambdifying becomes somethings like this:
>
> 10*sqrt(x)
>
> while I need :
>
> 10*numpy.sqrt(x)
>
> Could possibly let me know how get sqrt to work with numpy?

The function created by lambdify does use numpy. The code 10*sqrt(x)
will be executed in a namespace where sqrt refers to numpy.sqrt.

--
Oscar

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxRR%3DiJB%2B0%3DWrDiUw6QhKsFOvdg_iPFzC-g-F36G-kXtwQ%40mail.gmail.com.

Reply via email to