1 | initial version |
@Niles: P[k] works, but I need P_k in my loop. In fact I'm trying to substitute P_k by P[k]
@kcrisman: print(eval...) works fine, but N[k] = N[k].subs(eval('P_%s' %k = P[k])) doesn't (SyntaxError: keyword can't be an expression). But this is what I was aiming at.
One solution would be to redefine N[k] everytime any P_k changes. But that would kill my calculation period for bigger n, so that is my last resort