I use lambdify(....) a lot, but always like this:
x = sympy.symbols('x')
expr = symy.S(10.) * sympy.sqrt(x)
expr_lam = sympy.lambdify([x], expr)
a = expr_lam(10.)
This seems to work for me.
On Wed 17. Aug 2022 at 20:38, Zohreh Karimzadeh <[email protected]>
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?
>
> Regards,
>
> Zohreh
>
>
>
>
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/1f0b313f-31c5-402e-991e-142a556016f4n%40googlegroups.com
> <https://groups.google.com/d/msgid/sympy/1f0b313f-31c5-402e-991e-142a556016f4n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
Best regards,
Peter Stahlecker
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/CABKqA0ZoGwsadsk4SWCbJVMbCDwXcO_gNGumJH00GAeEFod7Cw%40mail.gmail.com.