I can write a wrapper function and use subs to realize the obj(input) 
functionality.
However, I still have no idea how can I convert f(x0, x1, ..., xn) to 
f(x[0], x[1], x[2], ..., x[n]) :(



在2022年5月20日星期五 UTC+2 07:35:57<Junjie Shi> 写道:

> Hi,
> I am a new hand in sympy. I have some questions when I using it. Could you 
> please help me?
>
> When I use "x = symbols('x:(n+1)')" to claim (n+1) variables, after the 
> calculations, I can get the results represented by x0, x1, x2,...xn, i.e., 
> f(x0, x1, ..., xn), where n can change from time to time.
> Now, I have several sets of input data, and I want to know the results of 
> the calculated function, i.e., f(input), where each set of input data has n 
> elements.
> I am trying to convert the  f(x0, x1, ..., xn) by using lambdify. For 
> example, I can only do obj = lambdify(x, f(x[0], x[1], x[2], ..., x[n])) 
> rather than lambdify(x, f(x0, x1, ..., xn)).
> How can I use the previous calculated f(x0, x1, ..., xn) in lambdify 
> directly?
>
> In addition, when I calculate the result, I can only do obj(input[0], 
> input[1], ..., input[n]), can I read the input array directly, i.e., 
> obj(input)?
>
> Thanks for your time.
>  
> Best,
> Junjie
>  
>

-- 
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/f28fb352-fc74-44de-9aa2-c88951fbc036n%40googlegroups.com.

Reply via email to