You can use sympy objects inside numpy arrays, see sympy/test_external/ test_numpy.py.
However, to use subs with numpy arrays you would have to implement this operation first. Did you have actually a look at lambdify? It supports numpy. Vinzent On Jan 28, 6:17 pm, Nikolas Tezak <[email protected]> wrote: > This goes a lot further than what I would need. I would not even need > the array indices to be symbolic expressions (although it certainly > would be nice to have that option). I would only like to substitute a > very large numpy array into a symbolic expression that is then > completely determined and should be evaluated (as efficiently as > possible). I understand of course that this is a bit specialized. > > Nikolas > > Am 27.01.2010 um 23:47 schrieb Aaron S. Meurer: > > > If I understand you correctly, it is related to this: > > http://code.google.com/p/sympy/issues/detail?id=16 > > > Symbols with indices is something that would be nice to have > > implemented, but unfortunately isn't yet. So maybe the information > > on that page will help you. > > > Aaron Meurer > > On Jan 27, 2010, at 3:44 PM, Nikolas Tezak wrote: > > >> Hi, > > >> I am wondering if it were in principle possible to create subclass > >> of Symbol, that could handle array indices, so that at a later time > >> (after having performed symbolic calculations) I could just > >> substitute a numpy array in for that symbol. > > >> e.g. (10 + a[:,0] *a[:,1]).subst(a, np.array([[...]]) > >> Of course I could simply create symbols for individual array > >> elements, but I am working with a large number of coefficients > >> (~1000+) for which it would seem inefficient (at least to me) to > >> create individual symbols. > > >> I am still trying to get a good feeling for the code and I will try > >> to implement it myself, but maybe some of you already know of some > >> reason why this would not work (efficiently). > > >> Nikolas > > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
